(self["webpackChunk_N_E"] = self["webpackChunk_N_E"] || []).push([ [ 514 ], { 8161: (function(t, e, r) { const n = r(6266); const i = r(3783); const { sha256: o } = r(2023); const { sha512: s } = r(3434); const a = new n.ec('secp256k1'); function f(t) { return new Uint8Array([ (t & 0xff000000) >> 24, (t & 0x00ff0000) >> 16, (t & 0x0000ff00) >> 8, t & 0x000000ff ]); } const u = new i(1); function c(t) { const e = (a.n.bitLength() + 7) >> 3; a.g.mul(10); if ((t[0] & ~1) != 2) { return [ null, null ]; } if (t.length != 1 + e) return [ null, null ]; const r = new i(t.slice(1, 1 + e)); try { const n = a.curve.pointFromX(r); return [ n.x, n.y ]; } catch (o) { return [ null, null ]; } } function l(t) { let e = null, r = null; const n = (a.n.bitLength() + 7) >> 3; let i = 0; while(e == null && i < 100){ const o = s.array(new Uint8Array([ ...f(i), ...t ])); const u = [ 2, ...o ]; [e, r] = c(u.slice(0, n + 1)); i++; } return a.curve.point(e, r); } function h(t) { const e = (a.n.bitLength() + 7) >> 3; let r = 0; while(true){ const n = s.array(new Uint8Array([ ...f(r), ...t ])); const o = new i(n.slice(0, e)); if (o.cmp(a.curve.n.sub(u)) == -1) { return o.add(u); } r++; } } function d(t, e) { const r = a.keyFromPrivate(t); const n = a.genKeyPair(); const i = n.getPrivate(); const s = l(e); const f = s.mul(t); const u = f.encode(); const c = a.curve.g.mul(i); const d = s.mul(i); const p = [ ...a.curve.g.encode(), ...s.encode(), ...r.getPublic().encode(), ...u, ...c.encode(), ...d.encode() ]; const g = h(p); const b = i.sub(g.mul(r.getPrivate())).umod(a.curve.n); const v = o.array(new Uint8Array(u)); const y = [ ...new Array(32 - g.byteLength()).fill(0), ...g.toArray(), ...new Array(32 - b.byteLength()).fill(0), ...b.toArray(), ...u ]; return [ v, y ]; } function p(t, e, r) { const n = a.keyFromPublic(t); if (r.length !== 64 + 65) { throw new Error('invalid vrf'); } const i = r.slice(0, 32); const s = r.slice(32, 64); const f = r.slice(64, 64 + 65); const u = g(f); if (!u) { throw new Error('invalid vrf'); } const c = a.curve.g.mul(s); const d = n.getPublic().mul(i); const p = c.add(d); const b = l(e); const v = b.mul(s); const y = u.mul(i); const m = v.add(y); const w = [ ...a.curve.g.encode(), ...b.encode(), ...n.getPublic().encode(), ...f, ...p.encode(), ...m.encode() ]; const _ = h(w); const S = [ ...new Array(32 - _.byteLength()).fill(0), ..._.toArray() ]; let E = true; for(let x = 0; x < S.length; x++){ if (i[x] !== S[x]) { E = false; } } if (!E) { throw new Error('invalid vrf'); } return o.array(new Uint8Array(f)); } function g(t) { try { return a.curve.decodePoint(t); } catch { return null; } } t.exports = { Evaluate: d, ProofHoHash: p }; }), 3783: (function(t, e, r) { t = r.nmd(t); (function(t, e) { 'use strict'; function n(t, e) { if (!t) throw new Error(e || 'Assertion failed'); } function i(t, e) { t.super_ = e; var r = function() {}; r.prototype = e.prototype; t.prototype = new r(); t.prototype.constructor = t; } function o(t, e, r) { if (o.isBN(t)) { return t; } this.negative = 0; this.words = null; this.length = 0; this.red = null; if (t !== null) { if (e === 'le' || e === 'be') { r = e; e = 10; } this._init(t || 0, e || 10, r || 'be'); } } if (typeof t === 'object') { t.exports = o; } else { e.BN = o; } o.BN = o; o.wordSize = 26; var s; try { if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { s = window.Buffer; } else { s = (r(136).Buffer); } } catch (a) {} o.isBN = function t(e) { if (e instanceof o) { return true; } return e !== null && typeof e === 'object' && e.constructor.wordSize === o.wordSize && Array.isArray(e.words); }; o.max = function t(e, r) { if (e.cmp(r) > 0) return e; return r; }; o.min = function t(e, r) { if (e.cmp(r) < 0) return e; return r; }; o.prototype._init = function t(e, r, i) { if (typeof e === 'number') { return this._initNumber(e, r, i); } if (typeof e === 'object') { return this._initArray(e, r, i); } if (r === 'hex') { r = 16; } n(r === (r | 0) && r >= 2 && r <= 36); e = e.toString().replace(/\s+/g, ''); var o = 0; if (e[0] === '-') { o++; this.negative = 1; } if (o < e.length) { if (r === 16) { this._parseHex(e, o, i); } else { this._parseBase(e, r, o); if (i === 'le') { this._initArray(this.toArray(), r, i); } } } }; o.prototype._initNumber = function t(e, r, i) { if (e < 0) { this.negative = 1; e = -e; } if (e < 0x4000000) { this.words = [ e & 0x3ffffff ]; this.length = 1; } else if (e < 0x10000000000000) { this.words = [ e & 0x3ffffff, (e / 0x4000000) & 0x3ffffff ]; this.length = 2; } else { n(e < 0x20000000000000); this.words = [ e & 0x3ffffff, (e / 0x4000000) & 0x3ffffff, 1 ]; this.length = 3; } if (i !== 'le') return; this._initArray(this.toArray(), r, i); }; o.prototype._initArray = function t(e, r, i) { n(typeof e.length === 'number'); if (e.length <= 0) { this.words = [ 0 ]; this.length = 1; return this; } this.length = Math.ceil(e.length / 3); this.words = new Array(this.length); for(var o = 0; o < this.length; o++){ this.words[o] = 0; } var s, a; var f = 0; if (i === 'be') { for(o = e.length - 1, s = 0; o >= 0; o -= 3){ a = e[o] | (e[o - 1] << 8) | (e[o - 2] << 16); this.words[s] |= (a << f) & 0x3ffffff; this.words[s + 1] = (a >>> (26 - f)) & 0x3ffffff; f += 24; if (f >= 26) { f -= 26; s++; } } } else if (i === 'le') { for(o = 0, s = 0; o < e.length; o += 3){ a = e[o] | (e[o + 1] << 8) | (e[o + 2] << 16); this.words[s] |= (a << f) & 0x3ffffff; this.words[s + 1] = (a >>> (26 - f)) & 0x3ffffff; f += 24; if (f >= 26) { f -= 26; s++; } } } return this._strip(); }; function f(t, e) { var r = t.charCodeAt(e); if (r >= 48 && r <= 57) { return r - 48; } else if (r >= 65 && r <= 70) { return r - 55; } else if (r >= 97 && r <= 102) { return r - 87; } else { n(false, 'Invalid character in ' + t); } } function u(t, e, r) { var n = f(t, r); if (r - 1 >= e) { n |= f(t, r - 1) << 4; } return n; } o.prototype._parseHex = function t(e, r, n) { this.length = Math.ceil((e.length - r) / 6); this.words = new Array(this.length); for(var i = 0; i < this.length; i++){ this.words[i] = 0; } var o = 0; var s = 0; var a; if (n === 'be') { for(i = e.length - 1; i >= r; i -= 2){ a = u(e, r, i) << o; this.words[s] |= a & 0x3ffffff; if (o >= 18) { o -= 18; s += 1; this.words[s] |= a >>> 26; } else { o += 8; } } } else { var f = e.length - r; for(i = f % 2 === 0 ? r + 1 : r; i < e.length; i += 2){ a = u(e, r, i) << o; this.words[s] |= a & 0x3ffffff; if (o >= 18) { o -= 18; s += 1; this.words[s] |= a >>> 26; } else { o += 8; } } } this._strip(); }; function c(t, e, r, i) { var o = 0; var s = 0; var a = Math.min(t.length, r); for(var f = e; f < a; f++){ var u = t.charCodeAt(f) - 48; o *= i; if (u >= 49) { s = u - 49 + 0xa; } else if (u >= 17) { s = u - 17 + 0xa; } else { s = u; } n(u >= 0 && s < i, 'Invalid character'); o += s; } return o; } o.prototype._parseBase = function t(e, r, n) { this.words = [ 0 ]; this.length = 1; for(var i = 0, o = 1; o <= 0x3ffffff; o *= r){ i++; } i--; o = (o / r) | 0; var s = e.length - n; var a = s % i; var f = Math.min(s, s - a) + n; var u = 0; for(var l = n; l < f; l += i){ u = c(e, l, l + i, r); this.imuln(o); if (this.words[0] + u < 0x4000000) { this.words[0] += u; } else { this._iaddn(u); } } if (a !== 0) { var h = 1; u = c(e, l, e.length, r); for(l = 0; l < a; l++){ h *= r; } this.imuln(h); if (this.words[0] + u < 0x4000000) { this.words[0] += u; } else { this._iaddn(u); } } this._strip(); }; o.prototype.copy = function t(e) { e.words = new Array(this.length); for(var r = 0; r < this.length; r++){ e.words[r] = this.words[r]; } e.length = this.length; e.negative = this.negative; e.red = this.red; }; function l(t, e) { t.words = e.words; t.length = e.length; t.negative = e.negative; t.red = e.red; } o.prototype._move = function t(e) { l(e, this); }; o.prototype.clone = function t() { var e = new o(null); this.copy(e); return e; }; o.prototype._expand = function t(e) { while(this.length < e){ this.words[this.length++] = 0; } return this; }; o.prototype._strip = function t() { while(this.length > 1 && this.words[this.length - 1] === 0){ this.length--; } return this._normSign(); }; o.prototype._normSign = function t() { if (this.length === 1 && this.words[0] === 0) { this.negative = 0; } return this; }; if (typeof Symbol !== 'undefined' && typeof Symbol.for === 'function') { try { o.prototype[Symbol.for('nodejs.util.inspect.custom')] = d; } catch (h) { o.prototype.inspect = d; } } else { o.prototype.inspect = d; } function d() { return (this.red ? ''; } var p = [ '', '0', '00', '000', '0000', '00000', '000000', '0000000', '00000000', '000000000', '0000000000', '00000000000', '000000000000', '0000000000000', '00000000000000', '000000000000000', '0000000000000000', '00000000000000000', '000000000000000000', '0000000000000000000', '00000000000000000000', '000000000000000000000', '0000000000000000000000', '00000000000000000000000', '000000000000000000000000', '0000000000000000000000000' ]; var g = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ]; var b = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ]; o.prototype.toString = function t(e, r) { e = e || 10; r = r | 0 || 1; var i; if (e === 16 || e === 'hex') { i = ''; var o = 0; var s = 0; for(var a = 0; a < this.length; a++){ var f = this.words[a]; var u = (((f << o) | s) & 0xffffff).toString(16); s = (f >>> (24 - o)) & 0xffffff; o += 2; if (o >= 26) { o -= 26; a--; } if (s !== 0 || a !== this.length - 1) { i = p[6 - u.length] + u + i; } else { i = u + i; } } if (s !== 0) { i = s.toString(16) + i; } while(i.length % r !== 0){ i = '0' + i; } if (this.negative !== 0) { i = '-' + i; } return i; } if (e === (e | 0) && e >= 2 && e <= 36) { var c = g[e]; var l = b[e]; i = ''; var h = this.clone(); h.negative = 0; while(!h.isZero()){ var d = h.modrn(l).toString(e); h = h.idivn(l); if (!h.isZero()) { i = p[c - d.length] + d + i; } else { i = d + i; } } if (this.isZero()) { i = '0' + i; } while(i.length % r !== 0){ i = '0' + i; } if (this.negative !== 0) { i = '-' + i; } return i; } n(false, 'Base should be between 2 and 36'); }; o.prototype.toNumber = function t() { var e = this.words[0]; if (this.length === 2) { e += this.words[1] * 0x4000000; } else if (this.length === 3 && this.words[2] === 0x01) { e += 0x10000000000000 + (this.words[1] * 0x4000000); } else if (this.length > 2) { n(false, 'Number can only safely store up to 53 bits'); } return (this.negative !== 0) ? -e : e; }; o.prototype.toJSON = function t() { return this.toString(16, 2); }; if (s) { o.prototype.toBuffer = function t(e, r) { return this.toArrayLike(s, e, r); }; } o.prototype.toArray = function t(e, r) { return this.toArrayLike(Array, e, r); }; var v = function t(e, r) { if (e.allocUnsafe) { return e.allocUnsafe(r); } return new e(r); }; o.prototype.toArrayLike = function t(e, r, i) { this._strip(); var o = this.byteLength(); var s = i || Math.max(1, o); n(o <= s, 'byte array longer than desired length'); n(s > 0, 'Requested array length <= 0'); var a = v(e, s); var f = r === 'le' ? 'LE' : 'BE'; this['_toArrayLike' + f](a, o); return a; }; o.prototype._toArrayLikeLE = function t(e, r) { var n = 0; var i = 0; for(var o = 0, s = 0; o < this.length; o++){ var a = (this.words[o] << s) | i; e[n++] = a & 0xff; if (n < e.length) { e[n++] = (a >> 8) & 0xff; } if (n < e.length) { e[n++] = (a >> 16) & 0xff; } if (s === 6) { if (n < e.length) { e[n++] = (a >> 24) & 0xff; } i = 0; s = 0; } else { i = a >>> 24; s += 2; } } if (n < e.length) { e[n++] = i; while(n < e.length){ e[n++] = 0; } } }; o.prototype._toArrayLikeBE = function t(e, r) { var n = e.length - 1; var i = 0; for(var o = 0, s = 0; o < this.length; o++){ var a = (this.words[o] << s) | i; e[n--] = a & 0xff; if (n >= 0) { e[n--] = (a >> 8) & 0xff; } if (n >= 0) { e[n--] = (a >> 16) & 0xff; } if (s === 6) { if (n >= 0) { e[n--] = (a >> 24) & 0xff; } i = 0; s = 0; } else { i = a >>> 24; s += 2; } } if (n >= 0) { e[n--] = i; while(n >= 0){ e[n--] = 0; } } }; if (Math.clz32) { o.prototype._countBits = function t(e) { return 32 - Math.clz32(e); }; } else { o.prototype._countBits = function t(e) { var r = e; var n = 0; if (r >= 0x1000) { n += 13; r >>>= 13; } if (r >= 0x40) { n += 7; r >>>= 7; } if (r >= 0x8) { n += 4; r >>>= 4; } if (r >= 0x02) { n += 2; r >>>= 2; } return n + r; }; } o.prototype._zeroBits = function t(e) { if (e === 0) return 26; var r = e; var n = 0; if ((r & 0x1fff) === 0) { n += 13; r >>>= 13; } if ((r & 0x7f) === 0) { n += 7; r >>>= 7; } if ((r & 0xf) === 0) { n += 4; r >>>= 4; } if ((r & 0x3) === 0) { n += 2; r >>>= 2; } if ((r & 0x1) === 0) { n++; } return n; }; o.prototype.bitLength = function t() { var e = this.words[this.length - 1]; var r = this._countBits(e); return (this.length - 1) * 26 + r; }; function y(t) { var e = new Array(t.bitLength()); for(var r = 0; r < e.length; r++){ var n = (r / 26) | 0; var i = r % 26; e[r] = (t.words[n] >>> i) & 0x01; } return e; } o.prototype.zeroBits = function t() { if (this.isZero()) return 0; var e = 0; for(var r = 0; r < this.length; r++){ var n = this._zeroBits(this.words[r]); e += n; if (n !== 26) break; } return e; }; o.prototype.byteLength = function t() { return Math.ceil(this.bitLength() / 8); }; o.prototype.toTwos = function t(e) { if (this.negative !== 0) { return this.abs().inotn(e).iaddn(1); } return this.clone(); }; o.prototype.fromTwos = function t(e) { if (this.testn(e - 1)) { return this.notn(e).iaddn(1).ineg(); } return this.clone(); }; o.prototype.isNeg = function t() { return this.negative !== 0; }; o.prototype.neg = function t() { return this.clone().ineg(); }; o.prototype.ineg = function t() { if (!this.isZero()) { this.negative ^= 1; } return this; }; o.prototype.iuor = function t(e) { while(this.length < e.length){ this.words[this.length++] = 0; } for(var r = 0; r < e.length; r++){ this.words[r] = this.words[r] | e.words[r]; } return this._strip(); }; o.prototype.ior = function t(e) { n((this.negative | e.negative) === 0); return this.iuor(e); }; o.prototype.or = function t(e) { if (this.length > e.length) return this.clone().ior(e); return e.clone().ior(this); }; o.prototype.uor = function t(e) { if (this.length > e.length) return this.clone().iuor(e); return e.clone().iuor(this); }; o.prototype.iuand = function t(e) { var r; if (this.length > e.length) { r = e; } else { r = this; } for(var n = 0; n < r.length; n++){ this.words[n] = this.words[n] & e.words[n]; } this.length = r.length; return this._strip(); }; o.prototype.iand = function t(e) { n((this.negative | e.negative) === 0); return this.iuand(e); }; o.prototype.and = function t(e) { if (this.length > e.length) return this.clone().iand(e); return e.clone().iand(this); }; o.prototype.uand = function t(e) { if (this.length > e.length) return this.clone().iuand(e); return e.clone().iuand(this); }; o.prototype.iuxor = function t(e) { var r; var n; if (this.length > e.length) { r = this; n = e; } else { r = e; n = this; } for(var i = 0; i < n.length; i++){ this.words[i] = r.words[i] ^ n.words[i]; } if (this !== r) { for(; i < r.length; i++){ this.words[i] = r.words[i]; } } this.length = r.length; return this._strip(); }; o.prototype.ixor = function t(e) { n((this.negative | e.negative) === 0); return this.iuxor(e); }; o.prototype.xor = function t(e) { if (this.length > e.length) return this.clone().ixor(e); return e.clone().ixor(this); }; o.prototype.uxor = function t(e) { if (this.length > e.length) return this.clone().iuxor(e); return e.clone().iuxor(this); }; o.prototype.inotn = function t(e) { n(typeof e === 'number' && e >= 0); var r = Math.ceil(e / 26) | 0; var i = e % 26; this._expand(r); if (i > 0) { r--; } for(var o = 0; o < r; o++){ this.words[o] = ~this.words[o] & 0x3ffffff; } if (i > 0) { this.words[o] = ~this.words[o] & (0x3ffffff >> (26 - i)); } return this._strip(); }; o.prototype.notn = function t(e) { return this.clone().inotn(e); }; o.prototype.setn = function t(e, r) { n(typeof e === 'number' && e >= 0); var i = (e / 26) | 0; var o = e % 26; this._expand(i + 1); if (r) { this.words[i] = this.words[i] | (1 << o); } else { this.words[i] = this.words[i] & ~(1 << o); } return this._strip(); }; o.prototype.iadd = function t(e) { var r; if (this.negative !== 0 && e.negative === 0) { this.negative = 0; r = this.isub(e); this.negative ^= 1; return this._normSign(); } else if (this.negative === 0 && e.negative !== 0) { e.negative = 0; r = this.isub(e); e.negative = 1; return r._normSign(); } var n, i; if (this.length > e.length) { n = this; i = e; } else { n = e; i = this; } var o = 0; for(var s = 0; s < i.length; s++){ r = (n.words[s] | 0) + (i.words[s] | 0) + o; this.words[s] = r & 0x3ffffff; o = r >>> 26; } for(; o !== 0 && s < n.length; s++){ r = (n.words[s] | 0) + o; this.words[s] = r & 0x3ffffff; o = r >>> 26; } this.length = n.length; if (o !== 0) { this.words[this.length] = o; this.length++; } else if (n !== this) { for(; s < n.length; s++){ this.words[s] = n.words[s]; } } return this; }; o.prototype.add = function t(e) { var r; if (e.negative !== 0 && this.negative === 0) { e.negative = 0; r = this.sub(e); e.negative ^= 1; return r; } else if (e.negative === 0 && this.negative !== 0) { this.negative = 0; r = e.sub(this); this.negative = 1; return r; } if (this.length > e.length) return this.clone().iadd(e); return e.clone().iadd(this); }; o.prototype.isub = function t(e) { if (e.negative !== 0) { e.negative = 0; var r = this.iadd(e); e.negative = 1; return r._normSign(); } else if (this.negative !== 0) { this.negative = 0; this.iadd(e); this.negative = 1; return this._normSign(); } var n = this.cmp(e); if (n === 0) { this.negative = 0; this.length = 1; this.words[0] = 0; return this; } var i, o; if (n > 0) { i = this; o = e; } else { i = e; o = this; } var s = 0; for(var a = 0; a < o.length; a++){ r = (i.words[a] | 0) - (o.words[a] | 0) + s; s = r >> 26; this.words[a] = r & 0x3ffffff; } for(; s !== 0 && a < i.length; a++){ r = (i.words[a] | 0) + s; s = r >> 26; this.words[a] = r & 0x3ffffff; } if (s === 0 && a < i.length && i !== this) { for(; a < i.length; a++){ this.words[a] = i.words[a]; } } this.length = Math.max(this.length, a); if (i !== this) { this.negative = 1; } return this._strip(); }; o.prototype.sub = function t(e) { return this.clone().isub(e); }; function m(t, e, r) { r.negative = e.negative ^ t.negative; var n = (t.length + e.length) | 0; r.length = n; n = (n - 1) | 0; var i = t.words[0] | 0; var o = e.words[0] | 0; var s = i * o; var a = s & 0x3ffffff; var f = (s / 0x4000000) | 0; r.words[0] = a; for(var u = 1; u < n; u++){ var c = f >>> 26; var l = f & 0x3ffffff; var h = Math.min(u, e.length - 1); for(var d = Math.max(0, u - t.length + 1); d <= h; d++){ var p = (u - d) | 0; i = t.words[p] | 0; o = e.words[d] | 0; s = i * o + l; c += (s / 0x4000000) | 0; l = s & 0x3ffffff; } r.words[u] = l | 0; f = c | 0; } if (f !== 0) { r.words[u] = f | 0; } else { r.length--; } return r._strip(); } var w = function t(e, r, n) { var i = e.words; var o = r.words; var s = n.words; var a = 0; var f; var u; var c; var l = i[0] | 0; var h = l & 0x1fff; var d = l >>> 13; var p = i[1] | 0; var g = p & 0x1fff; var b = p >>> 13; var v = i[2] | 0; var y = v & 0x1fff; var m = v >>> 13; var w = i[3] | 0; var _ = w & 0x1fff; var S = w >>> 13; var E = i[4] | 0; var x = E & 0x1fff; var M = E >>> 13; var T = i[5] | 0; var A = T & 0x1fff; var O = T >>> 13; var k = i[6] | 0; var I = k & 0x1fff; var R = k >>> 13; var N = i[7] | 0; var j = N & 0x1fff; var P = N >>> 13; var C = i[8] | 0; var B = C & 0x1fff; var L = C >>> 13; var U = i[9] | 0; var D = U & 0x1fff; var $ = U >>> 13; var F = o[0] | 0; var W = F & 0x1fff; var q = F >>> 13; var z = o[1] | 0; var G = z & 0x1fff; var K = z >>> 13; var V = o[2] | 0; var H = V & 0x1fff; var J = V >>> 13; var X = o[3] | 0; var Y = X & 0x1fff; var Z = X >>> 13; var Q = o[4] | 0; var tt = Q & 0x1fff; var te = Q >>> 13; var tr = o[5] | 0; var tn = tr & 0x1fff; var ti = tr >>> 13; var to = o[6] | 0; var ts = to & 0x1fff; var ta = to >>> 13; var tf = o[7] | 0; var tu = tf & 0x1fff; var tc = tf >>> 13; var tl = o[8] | 0; var th = tl & 0x1fff; var td = tl >>> 13; var tp = o[9] | 0; var tg = tp & 0x1fff; var tb = tp >>> 13; n.negative = e.negative ^ r.negative; n.length = 19; f = Math.imul(h, W); u = Math.imul(h, q); u = (u + Math.imul(d, W)) | 0; c = Math.imul(d, q); var tv = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tv >>> 26)) | 0; tv &= 0x3ffffff; f = Math.imul(g, W); u = Math.imul(g, q); u = (u + Math.imul(b, W)) | 0; c = Math.imul(b, q); f = (f + Math.imul(h, G)) | 0; u = (u + Math.imul(h, K)) | 0; u = (u + Math.imul(d, G)) | 0; c = (c + Math.imul(d, K)) | 0; var ty = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (ty >>> 26)) | 0; ty &= 0x3ffffff; f = Math.imul(y, W); u = Math.imul(y, q); u = (u + Math.imul(m, W)) | 0; c = Math.imul(m, q); f = (f + Math.imul(g, G)) | 0; u = (u + Math.imul(g, K)) | 0; u = (u + Math.imul(b, G)) | 0; c = (c + Math.imul(b, K)) | 0; f = (f + Math.imul(h, H)) | 0; u = (u + Math.imul(h, J)) | 0; u = (u + Math.imul(d, H)) | 0; c = (c + Math.imul(d, J)) | 0; var tm = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tm >>> 26)) | 0; tm &= 0x3ffffff; f = Math.imul(_, W); u = Math.imul(_, q); u = (u + Math.imul(S, W)) | 0; c = Math.imul(S, q); f = (f + Math.imul(y, G)) | 0; u = (u + Math.imul(y, K)) | 0; u = (u + Math.imul(m, G)) | 0; c = (c + Math.imul(m, K)) | 0; f = (f + Math.imul(g, H)) | 0; u = (u + Math.imul(g, J)) | 0; u = (u + Math.imul(b, H)) | 0; c = (c + Math.imul(b, J)) | 0; f = (f + Math.imul(h, Y)) | 0; u = (u + Math.imul(h, Z)) | 0; u = (u + Math.imul(d, Y)) | 0; c = (c + Math.imul(d, Z)) | 0; var tw = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tw >>> 26)) | 0; tw &= 0x3ffffff; f = Math.imul(x, W); u = Math.imul(x, q); u = (u + Math.imul(M, W)) | 0; c = Math.imul(M, q); f = (f + Math.imul(_, G)) | 0; u = (u + Math.imul(_, K)) | 0; u = (u + Math.imul(S, G)) | 0; c = (c + Math.imul(S, K)) | 0; f = (f + Math.imul(y, H)) | 0; u = (u + Math.imul(y, J)) | 0; u = (u + Math.imul(m, H)) | 0; c = (c + Math.imul(m, J)) | 0; f = (f + Math.imul(g, Y)) | 0; u = (u + Math.imul(g, Z)) | 0; u = (u + Math.imul(b, Y)) | 0; c = (c + Math.imul(b, Z)) | 0; f = (f + Math.imul(h, tt)) | 0; u = (u + Math.imul(h, te)) | 0; u = (u + Math.imul(d, tt)) | 0; c = (c + Math.imul(d, te)) | 0; var t_ = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (t_ >>> 26)) | 0; t_ &= 0x3ffffff; f = Math.imul(A, W); u = Math.imul(A, q); u = (u + Math.imul(O, W)) | 0; c = Math.imul(O, q); f = (f + Math.imul(x, G)) | 0; u = (u + Math.imul(x, K)) | 0; u = (u + Math.imul(M, G)) | 0; c = (c + Math.imul(M, K)) | 0; f = (f + Math.imul(_, H)) | 0; u = (u + Math.imul(_, J)) | 0; u = (u + Math.imul(S, H)) | 0; c = (c + Math.imul(S, J)) | 0; f = (f + Math.imul(y, Y)) | 0; u = (u + Math.imul(y, Z)) | 0; u = (u + Math.imul(m, Y)) | 0; c = (c + Math.imul(m, Z)) | 0; f = (f + Math.imul(g, tt)) | 0; u = (u + Math.imul(g, te)) | 0; u = (u + Math.imul(b, tt)) | 0; c = (c + Math.imul(b, te)) | 0; f = (f + Math.imul(h, tn)) | 0; u = (u + Math.imul(h, ti)) | 0; u = (u + Math.imul(d, tn)) | 0; c = (c + Math.imul(d, ti)) | 0; var tS = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tS >>> 26)) | 0; tS &= 0x3ffffff; f = Math.imul(I, W); u = Math.imul(I, q); u = (u + Math.imul(R, W)) | 0; c = Math.imul(R, q); f = (f + Math.imul(A, G)) | 0; u = (u + Math.imul(A, K)) | 0; u = (u + Math.imul(O, G)) | 0; c = (c + Math.imul(O, K)) | 0; f = (f + Math.imul(x, H)) | 0; u = (u + Math.imul(x, J)) | 0; u = (u + Math.imul(M, H)) | 0; c = (c + Math.imul(M, J)) | 0; f = (f + Math.imul(_, Y)) | 0; u = (u + Math.imul(_, Z)) | 0; u = (u + Math.imul(S, Y)) | 0; c = (c + Math.imul(S, Z)) | 0; f = (f + Math.imul(y, tt)) | 0; u = (u + Math.imul(y, te)) | 0; u = (u + Math.imul(m, tt)) | 0; c = (c + Math.imul(m, te)) | 0; f = (f + Math.imul(g, tn)) | 0; u = (u + Math.imul(g, ti)) | 0; u = (u + Math.imul(b, tn)) | 0; c = (c + Math.imul(b, ti)) | 0; f = (f + Math.imul(h, ts)) | 0; u = (u + Math.imul(h, ta)) | 0; u = (u + Math.imul(d, ts)) | 0; c = (c + Math.imul(d, ta)) | 0; var tE = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tE >>> 26)) | 0; tE &= 0x3ffffff; f = Math.imul(j, W); u = Math.imul(j, q); u = (u + Math.imul(P, W)) | 0; c = Math.imul(P, q); f = (f + Math.imul(I, G)) | 0; u = (u + Math.imul(I, K)) | 0; u = (u + Math.imul(R, G)) | 0; c = (c + Math.imul(R, K)) | 0; f = (f + Math.imul(A, H)) | 0; u = (u + Math.imul(A, J)) | 0; u = (u + Math.imul(O, H)) | 0; c = (c + Math.imul(O, J)) | 0; f = (f + Math.imul(x, Y)) | 0; u = (u + Math.imul(x, Z)) | 0; u = (u + Math.imul(M, Y)) | 0; c = (c + Math.imul(M, Z)) | 0; f = (f + Math.imul(_, tt)) | 0; u = (u + Math.imul(_, te)) | 0; u = (u + Math.imul(S, tt)) | 0; c = (c + Math.imul(S, te)) | 0; f = (f + Math.imul(y, tn)) | 0; u = (u + Math.imul(y, ti)) | 0; u = (u + Math.imul(m, tn)) | 0; c = (c + Math.imul(m, ti)) | 0; f = (f + Math.imul(g, ts)) | 0; u = (u + Math.imul(g, ta)) | 0; u = (u + Math.imul(b, ts)) | 0; c = (c + Math.imul(b, ta)) | 0; f = (f + Math.imul(h, tu)) | 0; u = (u + Math.imul(h, tc)) | 0; u = (u + Math.imul(d, tu)) | 0; c = (c + Math.imul(d, tc)) | 0; var tx = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tx >>> 26)) | 0; tx &= 0x3ffffff; f = Math.imul(B, W); u = Math.imul(B, q); u = (u + Math.imul(L, W)) | 0; c = Math.imul(L, q); f = (f + Math.imul(j, G)) | 0; u = (u + Math.imul(j, K)) | 0; u = (u + Math.imul(P, G)) | 0; c = (c + Math.imul(P, K)) | 0; f = (f + Math.imul(I, H)) | 0; u = (u + Math.imul(I, J)) | 0; u = (u + Math.imul(R, H)) | 0; c = (c + Math.imul(R, J)) | 0; f = (f + Math.imul(A, Y)) | 0; u = (u + Math.imul(A, Z)) | 0; u = (u + Math.imul(O, Y)) | 0; c = (c + Math.imul(O, Z)) | 0; f = (f + Math.imul(x, tt)) | 0; u = (u + Math.imul(x, te)) | 0; u = (u + Math.imul(M, tt)) | 0; c = (c + Math.imul(M, te)) | 0; f = (f + Math.imul(_, tn)) | 0; u = (u + Math.imul(_, ti)) | 0; u = (u + Math.imul(S, tn)) | 0; c = (c + Math.imul(S, ti)) | 0; f = (f + Math.imul(y, ts)) | 0; u = (u + Math.imul(y, ta)) | 0; u = (u + Math.imul(m, ts)) | 0; c = (c + Math.imul(m, ta)) | 0; f = (f + Math.imul(g, tu)) | 0; u = (u + Math.imul(g, tc)) | 0; u = (u + Math.imul(b, tu)) | 0; c = (c + Math.imul(b, tc)) | 0; f = (f + Math.imul(h, th)) | 0; u = (u + Math.imul(h, td)) | 0; u = (u + Math.imul(d, th)) | 0; c = (c + Math.imul(d, td)) | 0; var tM = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tM >>> 26)) | 0; tM &= 0x3ffffff; f = Math.imul(D, W); u = Math.imul(D, q); u = (u + Math.imul($, W)) | 0; c = Math.imul($, q); f = (f + Math.imul(B, G)) | 0; u = (u + Math.imul(B, K)) | 0; u = (u + Math.imul(L, G)) | 0; c = (c + Math.imul(L, K)) | 0; f = (f + Math.imul(j, H)) | 0; u = (u + Math.imul(j, J)) | 0; u = (u + Math.imul(P, H)) | 0; c = (c + Math.imul(P, J)) | 0; f = (f + Math.imul(I, Y)) | 0; u = (u + Math.imul(I, Z)) | 0; u = (u + Math.imul(R, Y)) | 0; c = (c + Math.imul(R, Z)) | 0; f = (f + Math.imul(A, tt)) | 0; u = (u + Math.imul(A, te)) | 0; u = (u + Math.imul(O, tt)) | 0; c = (c + Math.imul(O, te)) | 0; f = (f + Math.imul(x, tn)) | 0; u = (u + Math.imul(x, ti)) | 0; u = (u + Math.imul(M, tn)) | 0; c = (c + Math.imul(M, ti)) | 0; f = (f + Math.imul(_, ts)) | 0; u = (u + Math.imul(_, ta)) | 0; u = (u + Math.imul(S, ts)) | 0; c = (c + Math.imul(S, ta)) | 0; f = (f + Math.imul(y, tu)) | 0; u = (u + Math.imul(y, tc)) | 0; u = (u + Math.imul(m, tu)) | 0; c = (c + Math.imul(m, tc)) | 0; f = (f + Math.imul(g, th)) | 0; u = (u + Math.imul(g, td)) | 0; u = (u + Math.imul(b, th)) | 0; c = (c + Math.imul(b, td)) | 0; f = (f + Math.imul(h, tg)) | 0; u = (u + Math.imul(h, tb)) | 0; u = (u + Math.imul(d, tg)) | 0; c = (c + Math.imul(d, tb)) | 0; var tT = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tT >>> 26)) | 0; tT &= 0x3ffffff; f = Math.imul(D, G); u = Math.imul(D, K); u = (u + Math.imul($, G)) | 0; c = Math.imul($, K); f = (f + Math.imul(B, H)) | 0; u = (u + Math.imul(B, J)) | 0; u = (u + Math.imul(L, H)) | 0; c = (c + Math.imul(L, J)) | 0; f = (f + Math.imul(j, Y)) | 0; u = (u + Math.imul(j, Z)) | 0; u = (u + Math.imul(P, Y)) | 0; c = (c + Math.imul(P, Z)) | 0; f = (f + Math.imul(I, tt)) | 0; u = (u + Math.imul(I, te)) | 0; u = (u + Math.imul(R, tt)) | 0; c = (c + Math.imul(R, te)) | 0; f = (f + Math.imul(A, tn)) | 0; u = (u + Math.imul(A, ti)) | 0; u = (u + Math.imul(O, tn)) | 0; c = (c + Math.imul(O, ti)) | 0; f = (f + Math.imul(x, ts)) | 0; u = (u + Math.imul(x, ta)) | 0; u = (u + Math.imul(M, ts)) | 0; c = (c + Math.imul(M, ta)) | 0; f = (f + Math.imul(_, tu)) | 0; u = (u + Math.imul(_, tc)) | 0; u = (u + Math.imul(S, tu)) | 0; c = (c + Math.imul(S, tc)) | 0; f = (f + Math.imul(y, th)) | 0; u = (u + Math.imul(y, td)) | 0; u = (u + Math.imul(m, th)) | 0; c = (c + Math.imul(m, td)) | 0; f = (f + Math.imul(g, tg)) | 0; u = (u + Math.imul(g, tb)) | 0; u = (u + Math.imul(b, tg)) | 0; c = (c + Math.imul(b, tb)) | 0; var tA = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tA >>> 26)) | 0; tA &= 0x3ffffff; f = Math.imul(D, H); u = Math.imul(D, J); u = (u + Math.imul($, H)) | 0; c = Math.imul($, J); f = (f + Math.imul(B, Y)) | 0; u = (u + Math.imul(B, Z)) | 0; u = (u + Math.imul(L, Y)) | 0; c = (c + Math.imul(L, Z)) | 0; f = (f + Math.imul(j, tt)) | 0; u = (u + Math.imul(j, te)) | 0; u = (u + Math.imul(P, tt)) | 0; c = (c + Math.imul(P, te)) | 0; f = (f + Math.imul(I, tn)) | 0; u = (u + Math.imul(I, ti)) | 0; u = (u + Math.imul(R, tn)) | 0; c = (c + Math.imul(R, ti)) | 0; f = (f + Math.imul(A, ts)) | 0; u = (u + Math.imul(A, ta)) | 0; u = (u + Math.imul(O, ts)) | 0; c = (c + Math.imul(O, ta)) | 0; f = (f + Math.imul(x, tu)) | 0; u = (u + Math.imul(x, tc)) | 0; u = (u + Math.imul(M, tu)) | 0; c = (c + Math.imul(M, tc)) | 0; f = (f + Math.imul(_, th)) | 0; u = (u + Math.imul(_, td)) | 0; u = (u + Math.imul(S, th)) | 0; c = (c + Math.imul(S, td)) | 0; f = (f + Math.imul(y, tg)) | 0; u = (u + Math.imul(y, tb)) | 0; u = (u + Math.imul(m, tg)) | 0; c = (c + Math.imul(m, tb)) | 0; var tO = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tO >>> 26)) | 0; tO &= 0x3ffffff; f = Math.imul(D, Y); u = Math.imul(D, Z); u = (u + Math.imul($, Y)) | 0; c = Math.imul($, Z); f = (f + Math.imul(B, tt)) | 0; u = (u + Math.imul(B, te)) | 0; u = (u + Math.imul(L, tt)) | 0; c = (c + Math.imul(L, te)) | 0; f = (f + Math.imul(j, tn)) | 0; u = (u + Math.imul(j, ti)) | 0; u = (u + Math.imul(P, tn)) | 0; c = (c + Math.imul(P, ti)) | 0; f = (f + Math.imul(I, ts)) | 0; u = (u + Math.imul(I, ta)) | 0; u = (u + Math.imul(R, ts)) | 0; c = (c + Math.imul(R, ta)) | 0; f = (f + Math.imul(A, tu)) | 0; u = (u + Math.imul(A, tc)) | 0; u = (u + Math.imul(O, tu)) | 0; c = (c + Math.imul(O, tc)) | 0; f = (f + Math.imul(x, th)) | 0; u = (u + Math.imul(x, td)) | 0; u = (u + Math.imul(M, th)) | 0; c = (c + Math.imul(M, td)) | 0; f = (f + Math.imul(_, tg)) | 0; u = (u + Math.imul(_, tb)) | 0; u = (u + Math.imul(S, tg)) | 0; c = (c + Math.imul(S, tb)) | 0; var tk = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tk >>> 26)) | 0; tk &= 0x3ffffff; f = Math.imul(D, tt); u = Math.imul(D, te); u = (u + Math.imul($, tt)) | 0; c = Math.imul($, te); f = (f + Math.imul(B, tn)) | 0; u = (u + Math.imul(B, ti)) | 0; u = (u + Math.imul(L, tn)) | 0; c = (c + Math.imul(L, ti)) | 0; f = (f + Math.imul(j, ts)) | 0; u = (u + Math.imul(j, ta)) | 0; u = (u + Math.imul(P, ts)) | 0; c = (c + Math.imul(P, ta)) | 0; f = (f + Math.imul(I, tu)) | 0; u = (u + Math.imul(I, tc)) | 0; u = (u + Math.imul(R, tu)) | 0; c = (c + Math.imul(R, tc)) | 0; f = (f + Math.imul(A, th)) | 0; u = (u + Math.imul(A, td)) | 0; u = (u + Math.imul(O, th)) | 0; c = (c + Math.imul(O, td)) | 0; f = (f + Math.imul(x, tg)) | 0; u = (u + Math.imul(x, tb)) | 0; u = (u + Math.imul(M, tg)) | 0; c = (c + Math.imul(M, tb)) | 0; var tI = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tI >>> 26)) | 0; tI &= 0x3ffffff; f = Math.imul(D, tn); u = Math.imul(D, ti); u = (u + Math.imul($, tn)) | 0; c = Math.imul($, ti); f = (f + Math.imul(B, ts)) | 0; u = (u + Math.imul(B, ta)) | 0; u = (u + Math.imul(L, ts)) | 0; c = (c + Math.imul(L, ta)) | 0; f = (f + Math.imul(j, tu)) | 0; u = (u + Math.imul(j, tc)) | 0; u = (u + Math.imul(P, tu)) | 0; c = (c + Math.imul(P, tc)) | 0; f = (f + Math.imul(I, th)) | 0; u = (u + Math.imul(I, td)) | 0; u = (u + Math.imul(R, th)) | 0; c = (c + Math.imul(R, td)) | 0; f = (f + Math.imul(A, tg)) | 0; u = (u + Math.imul(A, tb)) | 0; u = (u + Math.imul(O, tg)) | 0; c = (c + Math.imul(O, tb)) | 0; var tR = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tR >>> 26)) | 0; tR &= 0x3ffffff; f = Math.imul(D, ts); u = Math.imul(D, ta); u = (u + Math.imul($, ts)) | 0; c = Math.imul($, ta); f = (f + Math.imul(B, tu)) | 0; u = (u + Math.imul(B, tc)) | 0; u = (u + Math.imul(L, tu)) | 0; c = (c + Math.imul(L, tc)) | 0; f = (f + Math.imul(j, th)) | 0; u = (u + Math.imul(j, td)) | 0; u = (u + Math.imul(P, th)) | 0; c = (c + Math.imul(P, td)) | 0; f = (f + Math.imul(I, tg)) | 0; u = (u + Math.imul(I, tb)) | 0; u = (u + Math.imul(R, tg)) | 0; c = (c + Math.imul(R, tb)) | 0; var tN = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tN >>> 26)) | 0; tN &= 0x3ffffff; f = Math.imul(D, tu); u = Math.imul(D, tc); u = (u + Math.imul($, tu)) | 0; c = Math.imul($, tc); f = (f + Math.imul(B, th)) | 0; u = (u + Math.imul(B, td)) | 0; u = (u + Math.imul(L, th)) | 0; c = (c + Math.imul(L, td)) | 0; f = (f + Math.imul(j, tg)) | 0; u = (u + Math.imul(j, tb)) | 0; u = (u + Math.imul(P, tg)) | 0; c = (c + Math.imul(P, tb)) | 0; var tj = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tj >>> 26)) | 0; tj &= 0x3ffffff; f = Math.imul(D, th); u = Math.imul(D, td); u = (u + Math.imul($, th)) | 0; c = Math.imul($, td); f = (f + Math.imul(B, tg)) | 0; u = (u + Math.imul(B, tb)) | 0; u = (u + Math.imul(L, tg)) | 0; c = (c + Math.imul(L, tb)) | 0; var tP = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tP >>> 26)) | 0; tP &= 0x3ffffff; f = Math.imul(D, tg); u = Math.imul(D, tb); u = (u + Math.imul($, tg)) | 0; c = Math.imul($, tb); var tC = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tC >>> 26)) | 0; tC &= 0x3ffffff; s[0] = tv; s[1] = ty; s[2] = tm; s[3] = tw; s[4] = t_; s[5] = tS; s[6] = tE; s[7] = tx; s[8] = tM; s[9] = tT; s[10] = tA; s[11] = tO; s[12] = tk; s[13] = tI; s[14] = tR; s[15] = tN; s[16] = tj; s[17] = tP; s[18] = tC; if (a !== 0) { s[19] = a; n.length++; } return n; }; if (!Math.imul) { w = m; } function _(t, e, r) { r.negative = e.negative ^ t.negative; r.length = t.length + e.length; var n = 0; var i = 0; for(var o = 0; o < r.length - 1; o++){ var s = i; i = 0; var a = n & 0x3ffffff; var f = Math.min(o, e.length - 1); for(var u = Math.max(0, o - t.length + 1); u <= f; u++){ var c = o - u; var l = t.words[c] | 0; var h = e.words[u] | 0; var d = l * h; var p = d & 0x3ffffff; s = (s + ((d / 0x4000000) | 0)) | 0; p = (p + a) | 0; a = p & 0x3ffffff; s = (s + (p >>> 26)) | 0; i += s >>> 26; s &= 0x3ffffff; } r.words[o] = a; n = s; s = i; } if (n !== 0) { r.words[o] = n; } else { r.length--; } return r._strip(); } function S(t, e, r) { return _(t, e, r); } o.prototype.mulTo = function t(e, r) { var n; var i = this.length + e.length; if (this.length === 10 && e.length === 10) { n = w(this, e, r); } else if (i < 63) { n = m(this, e, r); } else if (i < 1024) { n = _(this, e, r); } else { n = S(this, e, r); } return n; }; function E(t, e) { this.x = t; this.y = e; } E.prototype.makeRBT = function t(e) { var r = new Array(e); var n = o.prototype._countBits(e) - 1; for(var i = 0; i < e; i++){ r[i] = this.revBin(i, n, e); } return r; }; E.prototype.revBin = function t(e, r, n) { if (e === 0 || e === n - 1) return e; var i = 0; for(var o = 0; o < r; o++){ i |= (e & 1) << (r - o - 1); e >>= 1; } return i; }; E.prototype.permute = function t(e, r, n, i, o, s) { for(var a = 0; a < s; a++){ i[a] = r[e[a]]; o[a] = n[e[a]]; } }; E.prototype.transform = function t(e, r, n, i, o, s) { this.permute(s, e, r, n, i, o); for(var a = 1; a < o; a <<= 1){ var f = a << 1; var u = Math.cos(2 * Math.PI / f); var c = Math.sin(2 * Math.PI / f); for(var l = 0; l < o; l += f){ var h = u; var d = c; for(var p = 0; p < a; p++){ var g = n[l + p]; var b = i[l + p]; var v = n[l + p + a]; var y = i[l + p + a]; var m = h * v - d * y; y = h * y + d * v; v = m; n[l + p] = g + v; i[l + p] = b + y; n[l + p + a] = g - v; i[l + p + a] = b - y; if (p !== f) { m = u * h - c * d; d = u * d + c * h; h = m; } } } } }; E.prototype.guessLen13b = function t(e, r) { var n = Math.max(r, e) | 1; var i = n & 1; var o = 0; for(n = n / 2 | 0; n; n = n >>> 1){ o++; } return 1 << o + 1 + i; }; E.prototype.conjugate = function t(e, r, n) { if (n <= 1) return; for(var i = 0; i < n / 2; i++){ var o = e[i]; e[i] = e[n - i - 1]; e[n - i - 1] = o; o = r[i]; r[i] = -r[n - i - 1]; r[n - i - 1] = -o; } }; E.prototype.normalize13b = function t(e, r) { var n = 0; for(var i = 0; i < r / 2; i++){ var o = Math.round(e[2 * i + 1] / r) * 0x2000 + Math.round(e[2 * i] / r) + n; e[i] = o & 0x3ffffff; if (o < 0x4000000) { n = 0; } else { n = o / 0x4000000 | 0; } } return e; }; E.prototype.convert13b = function t(e, r, i, o) { var s = 0; for(var a = 0; a < r; a++){ s = s + (e[a] | 0); i[2 * a] = s & 0x1fff; s = s >>> 13; i[2 * a + 1] = s & 0x1fff; s = s >>> 13; } for(a = 2 * r; a < o; ++a){ i[a] = 0; } n(s === 0); n((s & ~0x1fff) === 0); }; E.prototype.stub = function t(e) { var r = new Array(e); for(var n = 0; n < e; n++){ r[n] = 0; } return r; }; E.prototype.mulp = function t(e, r, n) { var i = 2 * this.guessLen13b(e.length, r.length); var o = this.makeRBT(i); var s = this.stub(i); var a = new Array(i); var f = new Array(i); var u = new Array(i); var c = new Array(i); var l = new Array(i); var h = new Array(i); var d = n.words; d.length = i; this.convert13b(e.words, e.length, a, i); this.convert13b(r.words, r.length, c, i); this.transform(a, s, f, u, i, o); this.transform(c, s, l, h, i, o); for(var p = 0; p < i; p++){ var g = f[p] * l[p] - u[p] * h[p]; u[p] = f[p] * h[p] + u[p] * l[p]; f[p] = g; } this.conjugate(f, u, i); this.transform(f, u, d, s, i, o); this.conjugate(d, s, i); this.normalize13b(d, i); n.negative = e.negative ^ r.negative; n.length = e.length + r.length; return n._strip(); }; o.prototype.mul = function t(e) { var r = new o(null); r.words = new Array(this.length + e.length); return this.mulTo(e, r); }; o.prototype.mulf = function t(e) { var r = new o(null); r.words = new Array(this.length + e.length); return S(this, e, r); }; o.prototype.imul = function t(e) { return this.clone().mulTo(e, this); }; o.prototype.imuln = function t(e) { var r = e < 0; if (r) e = -e; n(typeof e === 'number'); n(e < 0x4000000); var i = 0; for(var o = 0; o < this.length; o++){ var s = (this.words[o] | 0) * e; var a = (s & 0x3ffffff) + (i & 0x3ffffff); i >>= 26; i += (s / 0x4000000) | 0; i += a >>> 26; this.words[o] = a & 0x3ffffff; } if (i !== 0) { this.words[o] = i; this.length++; } return r ? this.ineg() : this; }; o.prototype.muln = function t(e) { return this.clone().imuln(e); }; o.prototype.sqr = function t() { return this.mul(this); }; o.prototype.isqr = function t() { return this.imul(this.clone()); }; o.prototype.pow = function t(e) { var r = y(e); if (r.length === 0) return new o(1); var n = this; for(var i = 0; i < r.length; i++, n = n.sqr()){ if (r[i] !== 0) break; } if (++i < r.length) { for(var s = n.sqr(); i < r.length; i++, s = s.sqr()){ if (r[i] === 0) continue; n = n.mul(s); } } return n; }; o.prototype.iushln = function t(e) { n(typeof e === 'number' && e >= 0); var r = e % 26; var i = (e - r) / 26; var o = (0x3ffffff >>> (26 - r)) << (26 - r); var s; if (r !== 0) { var a = 0; for(s = 0; s < this.length; s++){ var f = this.words[s] & o; var u = ((this.words[s] | 0) - f) << r; this.words[s] = u | a; a = f >>> (26 - r); } if (a) { this.words[s] = a; this.length++; } } if (i !== 0) { for(s = this.length - 1; s >= 0; s--){ this.words[s + i] = this.words[s]; } for(s = 0; s < i; s++){ this.words[s] = 0; } this.length += i; } return this._strip(); }; o.prototype.ishln = function t(e) { n(this.negative === 0); return this.iushln(e); }; o.prototype.iushrn = function t(e, r, i) { n(typeof e === 'number' && e >= 0); var o; if (r) { o = (r - (r % 26)) / 26; } else { o = 0; } var s = e % 26; var a = Math.min((e - s) / 26, this.length); var f = 0x3ffffff ^ ((0x3ffffff >>> s) << s); var u = i; o -= a; o = Math.max(0, o); if (u) { for(var c = 0; c < a; c++){ u.words[c] = this.words[c]; } u.length = a; } if (a === 0) {} else if (this.length > a) { this.length -= a; for(c = 0; c < this.length; c++){ this.words[c] = this.words[c + a]; } } else { this.words[0] = 0; this.length = 1; } var l = 0; for(c = this.length - 1; c >= 0 && (l !== 0 || c >= o); c--){ var h = this.words[c] | 0; this.words[c] = (l << (26 - s)) | (h >>> s); l = h & f; } if (u && l !== 0) { u.words[u.length++] = l; } if (this.length === 0) { this.words[0] = 0; this.length = 1; } return this._strip(); }; o.prototype.ishrn = function t(e, r, i) { n(this.negative === 0); return this.iushrn(e, r, i); }; o.prototype.shln = function t(e) { return this.clone().ishln(e); }; o.prototype.ushln = function t(e) { return this.clone().iushln(e); }; o.prototype.shrn = function t(e) { return this.clone().ishrn(e); }; o.prototype.ushrn = function t(e) { return this.clone().iushrn(e); }; o.prototype.testn = function t(e) { n(typeof e === 'number' && e >= 0); var r = e % 26; var i = (e - r) / 26; var o = 1 << r; if (this.length <= i) return false; var s = this.words[i]; return !!(s & o); }; o.prototype.imaskn = function t(e) { n(typeof e === 'number' && e >= 0); var r = e % 26; var i = (e - r) / 26; n(this.negative === 0, 'imaskn works only with positive numbers'); if (this.length <= i) { return this; } if (r !== 0) { i++; } this.length = Math.min(i, this.length); if (r !== 0) { var o = 0x3ffffff ^ ((0x3ffffff >>> r) << r); this.words[this.length - 1] &= o; } return this._strip(); }; o.prototype.maskn = function t(e) { return this.clone().imaskn(e); }; o.prototype.iaddn = function t(e) { n(typeof e === 'number'); n(e < 0x4000000); if (e < 0) return this.isubn(-e); if (this.negative !== 0) { if (this.length === 1 && (this.words[0] | 0) <= e) { this.words[0] = e - (this.words[0] | 0); this.negative = 0; return this; } this.negative = 0; this.isubn(e); this.negative = 1; return this; } return this._iaddn(e); }; o.prototype._iaddn = function t(e) { this.words[0] += e; for(var r = 0; r < this.length && this.words[r] >= 0x4000000; r++){ this.words[r] -= 0x4000000; if (r === this.length - 1) { this.words[r + 1] = 1; } else { this.words[r + 1]++; } } this.length = Math.max(this.length, r + 1); return this; }; o.prototype.isubn = function t(e) { n(typeof e === 'number'); n(e < 0x4000000); if (e < 0) return this.iaddn(-e); if (this.negative !== 0) { this.negative = 0; this.iaddn(e); this.negative = 1; return this; } this.words[0] -= e; if (this.length === 1 && this.words[0] < 0) { this.words[0] = -this.words[0]; this.negative = 1; } else { for(var r = 0; r < this.length && this.words[r] < 0; r++){ this.words[r] += 0x4000000; this.words[r + 1] -= 1; } } return this._strip(); }; o.prototype.addn = function t(e) { return this.clone().iaddn(e); }; o.prototype.subn = function t(e) { return this.clone().isubn(e); }; o.prototype.iabs = function t() { this.negative = 0; return this; }; o.prototype.abs = function t() { return this.clone().iabs(); }; o.prototype._ishlnsubmul = function t(e, r, i) { var o = e.length + i; var s; this._expand(o); var a; var f = 0; for(s = 0; s < e.length; s++){ a = (this.words[s + i] | 0) + f; var u = (e.words[s] | 0) * r; a -= u & 0x3ffffff; f = (a >> 26) - ((u / 0x4000000) | 0); this.words[s + i] = a & 0x3ffffff; } for(; s < this.length - i; s++){ a = (this.words[s + i] | 0) + f; f = a >> 26; this.words[s + i] = a & 0x3ffffff; } if (f === 0) return this._strip(); n(f === -1); f = 0; for(s = 0; s < this.length; s++){ a = -(this.words[s] | 0) + f; f = a >> 26; this.words[s] = a & 0x3ffffff; } this.negative = 1; return this._strip(); }; o.prototype._wordDiv = function t(e, r) { var n = this.length - e.length; var i = this.clone(); var s = e; var a = s.words[s.length - 1] | 0; var f = this._countBits(a); n = 26 - f; if (n !== 0) { s = s.ushln(n); i.iushln(n); a = s.words[s.length - 1] | 0; } var u = i.length - s.length; var c; if (r !== 'mod') { c = new o(null); c.length = u + 1; c.words = new Array(c.length); for(var l = 0; l < c.length; l++){ c.words[l] = 0; } } var h = i.clone()._ishlnsubmul(s, 1, u); if (h.negative === 0) { i = h; if (c) { c.words[u] = 1; } } for(var d = u - 1; d >= 0; d--){ var p = (i.words[s.length + d] | 0) * 0x4000000 + (i.words[s.length + d - 1] | 0); p = Math.min((p / a) | 0, 0x3ffffff); i._ishlnsubmul(s, p, d); while(i.negative !== 0){ p--; i.negative = 0; i._ishlnsubmul(s, 1, d); if (!i.isZero()) { i.negative ^= 1; } } if (c) { c.words[d] = p; } } if (c) { c._strip(); } i._strip(); if (r !== 'div' && n !== 0) { i.iushrn(n); } return { div: c || null, mod: i }; }; o.prototype.divmod = function t(e, r, i) { n(!e.isZero()); if (this.isZero()) { return { div: new o(0), mod: new o(0) }; } var s, a, f; if (this.negative !== 0 && e.negative === 0) { f = this.neg().divmod(e, r); if (r !== 'mod') { s = f.div.neg(); } if (r !== 'div') { a = f.mod.neg(); if (i && a.negative !== 0) { a.iadd(e); } } return { div: s, mod: a }; } if (this.negative === 0 && e.negative !== 0) { f = this.divmod(e.neg(), r); if (r !== 'mod') { s = f.div.neg(); } return { div: s, mod: f.mod }; } if ((this.negative & e.negative) !== 0) { f = this.neg().divmod(e.neg(), r); if (r !== 'div') { a = f.mod.neg(); if (i && a.negative !== 0) { a.isub(e); } } return { div: f.div, mod: a }; } if (e.length > this.length || this.cmp(e) < 0) { return { div: new o(0), mod: this }; } if (e.length === 1) { if (r === 'div') { return { div: this.divn(e.words[0]), mod: null }; } if (r === 'mod') { return { div: null, mod: new o(this.modrn(e.words[0])) }; } return { div: this.divn(e.words[0]), mod: new o(this.modrn(e.words[0])) }; } return this._wordDiv(e, r); }; o.prototype.div = function t(e) { return this.divmod(e, 'div', false).div; }; o.prototype.mod = function t(e) { return this.divmod(e, 'mod', false).mod; }; o.prototype.umod = function t(e) { return this.divmod(e, 'mod', true).mod; }; o.prototype.divRound = function t(e) { var r = this.divmod(e); if (r.mod.isZero()) return r.div; var n = r.div.negative !== 0 ? r.mod.isub(e) : r.mod; var i = e.ushrn(1); var o = e.andln(1); var s = n.cmp(i); if (s < 0 || (o === 1 && s === 0)) return r.div; return r.div.negative !== 0 ? r.div.isubn(1) : r.div.iaddn(1); }; o.prototype.modrn = function t(e) { var r = e < 0; if (r) e = -e; n(e <= 0x3ffffff); var i = (1 << 26) % e; var o = 0; for(var s = this.length - 1; s >= 0; s--){ o = (i * o + (this.words[s] | 0)) % e; } return r ? -o : o; }; o.prototype.modn = function t(e) { return this.modrn(e); }; o.prototype.idivn = function t(e) { var r = e < 0; if (r) e = -e; n(e <= 0x3ffffff); var i = 0; for(var o = this.length - 1; o >= 0; o--){ var s = (this.words[o] | 0) + i * 0x4000000; this.words[o] = (s / e) | 0; i = s % e; } this._strip(); return r ? this.ineg() : this; }; o.prototype.divn = function t(e) { return this.clone().idivn(e); }; o.prototype.egcd = function t(e) { n(e.negative === 0); n(!e.isZero()); var r = this; var i = e.clone(); if (r.negative !== 0) { r = r.umod(e); } else { r = r.clone(); } var s = new o(1); var a = new o(0); var f = new o(0); var u = new o(1); var c = 0; while(r.isEven() && i.isEven()){ r.iushrn(1); i.iushrn(1); ++c; } var l = i.clone(); var h = r.clone(); while(!r.isZero()){ for(var d = 0, p = 1; (r.words[0] & p) === 0 && d < 26; ++d, p <<= 1); if (d > 0) { r.iushrn(d); while(d-- > 0){ if (s.isOdd() || a.isOdd()) { s.iadd(l); a.isub(h); } s.iushrn(1); a.iushrn(1); } } for(var g = 0, b = 1; (i.words[0] & b) === 0 && g < 26; ++g, b <<= 1); if (g > 0) { i.iushrn(g); while(g-- > 0){ if (f.isOdd() || u.isOdd()) { f.iadd(l); u.isub(h); } f.iushrn(1); u.iushrn(1); } } if (r.cmp(i) >= 0) { r.isub(i); s.isub(f); a.isub(u); } else { i.isub(r); f.isub(s); u.isub(a); } } return { a: f, b: u, gcd: i.iushln(c) }; }; o.prototype._invmp = function t(e) { n(e.negative === 0); n(!e.isZero()); var r = this; var i = e.clone(); if (r.negative !== 0) { r = r.umod(e); } else { r = r.clone(); } var s = new o(1); var a = new o(0); var f = i.clone(); while(r.cmpn(1) > 0 && i.cmpn(1) > 0){ for(var u = 0, c = 1; (r.words[0] & c) === 0 && u < 26; ++u, c <<= 1); if (u > 0) { r.iushrn(u); while(u-- > 0){ if (s.isOdd()) { s.iadd(f); } s.iushrn(1); } } for(var l = 0, h = 1; (i.words[0] & h) === 0 && l < 26; ++l, h <<= 1); if (l > 0) { i.iushrn(l); while(l-- > 0){ if (a.isOdd()) { a.iadd(f); } a.iushrn(1); } } if (r.cmp(i) >= 0) { r.isub(i); s.isub(a); } else { i.isub(r); a.isub(s); } } var d; if (r.cmpn(1) === 0) { d = s; } else { d = a; } if (d.cmpn(0) < 0) { d.iadd(e); } return d; }; o.prototype.gcd = function t(e) { if (this.isZero()) return e.abs(); if (e.isZero()) return this.abs(); var r = this.clone(); var n = e.clone(); r.negative = 0; n.negative = 0; for(var i = 0; r.isEven() && n.isEven(); i++){ r.iushrn(1); n.iushrn(1); } do { while(r.isEven()){ r.iushrn(1); } while(n.isEven()){ n.iushrn(1); } var o = r.cmp(n); if (o < 0) { var s = r; r = n; n = s; } else if (o === 0 || n.cmpn(1) === 0) { break; } r.isub(n); }while (true) return n.iushln(i); }; o.prototype.invm = function t(e) { return this.egcd(e).a.umod(e); }; o.prototype.isEven = function t() { return (this.words[0] & 1) === 0; }; o.prototype.isOdd = function t() { return (this.words[0] & 1) === 1; }; o.prototype.andln = function t(e) { return this.words[0] & e; }; o.prototype.bincn = function t(e) { n(typeof e === 'number'); var r = e % 26; var i = (e - r) / 26; var o = 1 << r; if (this.length <= i) { this._expand(i + 1); this.words[i] |= o; return this; } var s = o; for(var a = i; s !== 0 && a < this.length; a++){ var f = this.words[a] | 0; f += s; s = f >>> 26; f &= 0x3ffffff; this.words[a] = f; } if (s !== 0) { this.words[a] = s; this.length++; } return this; }; o.prototype.isZero = function t() { return this.length === 1 && this.words[0] === 0; }; o.prototype.cmpn = function t(e) { var r = e < 0; if (this.negative !== 0 && !r) return -1; if (this.negative === 0 && r) return 1; this._strip(); var i; if (this.length > 1) { i = 1; } else { if (r) { e = -e; } n(e <= 0x3ffffff, 'Number is too big'); var o = this.words[0] | 0; i = o === e ? 0 : o < e ? -1 : 1; } if (this.negative !== 0) return -i | 0; return i; }; o.prototype.cmp = function t(e) { if (this.negative !== 0 && e.negative === 0) return -1; if (this.negative === 0 && e.negative !== 0) return 1; var r = this.ucmp(e); if (this.negative !== 0) return -r | 0; return r; }; o.prototype.ucmp = function t(e) { if (this.length > e.length) return 1; if (this.length < e.length) return -1; var r = 0; for(var n = this.length - 1; n >= 0; n--){ var i = this.words[n] | 0; var o = e.words[n] | 0; if (i === o) continue; if (i < o) { r = -1; } else if (i > o) { r = 1; } break; } return r; }; o.prototype.gtn = function t(e) { return this.cmpn(e) === 1; }; o.prototype.gt = function t(e) { return this.cmp(e) === 1; }; o.prototype.gten = function t(e) { return this.cmpn(e) >= 0; }; o.prototype.gte = function t(e) { return this.cmp(e) >= 0; }; o.prototype.ltn = function t(e) { return this.cmpn(e) === -1; }; o.prototype.lt = function t(e) { return this.cmp(e) === -1; }; o.prototype.lten = function t(e) { return this.cmpn(e) <= 0; }; o.prototype.lte = function t(e) { return this.cmp(e) <= 0; }; o.prototype.eqn = function t(e) { return this.cmpn(e) === 0; }; o.prototype.eq = function t(e) { return this.cmp(e) === 0; }; o.red = function t(e) { return new I(e); }; o.prototype.toRed = function t(e) { n(!this.red, 'Already a number in reduction context'); n(this.negative === 0, 'red works only with positives'); return e.convertTo(this)._forceRed(e); }; o.prototype.fromRed = function t() { n(this.red, 'fromRed works only with numbers in reduction context'); return this.red.convertFrom(this); }; o.prototype._forceRed = function t(e) { this.red = e; return this; }; o.prototype.forceRed = function t(e) { n(!this.red, 'Already a number in reduction context'); return this._forceRed(e); }; o.prototype.redAdd = function t(e) { n(this.red, 'redAdd works only with red numbers'); return this.red.add(this, e); }; o.prototype.redIAdd = function t(e) { n(this.red, 'redIAdd works only with red numbers'); return this.red.iadd(this, e); }; o.prototype.redSub = function t(e) { n(this.red, 'redSub works only with red numbers'); return this.red.sub(this, e); }; o.prototype.redISub = function t(e) { n(this.red, 'redISub works only with red numbers'); return this.red.isub(this, e); }; o.prototype.redShl = function t(e) { n(this.red, 'redShl works only with red numbers'); return this.red.shl(this, e); }; o.prototype.redMul = function t(e) { n(this.red, 'redMul works only with red numbers'); this.red._verify2(this, e); return this.red.mul(this, e); }; o.prototype.redIMul = function t(e) { n(this.red, 'redMul works only with red numbers'); this.red._verify2(this, e); return this.red.imul(this, e); }; o.prototype.redSqr = function t() { n(this.red, 'redSqr works only with red numbers'); this.red._verify1(this); return this.red.sqr(this); }; o.prototype.redISqr = function t() { n(this.red, 'redISqr works only with red numbers'); this.red._verify1(this); return this.red.isqr(this); }; o.prototype.redSqrt = function t() { n(this.red, 'redSqrt works only with red numbers'); this.red._verify1(this); return this.red.sqrt(this); }; o.prototype.redInvm = function t() { n(this.red, 'redInvm works only with red numbers'); this.red._verify1(this); return this.red.invm(this); }; o.prototype.redNeg = function t() { n(this.red, 'redNeg works only with red numbers'); this.red._verify1(this); return this.red.neg(this); }; o.prototype.redPow = function t(e) { n(this.red && !e.red, 'redPow(normalNum)'); this.red._verify1(this); return this.red.pow(this, e); }; var x = { k256: null, p224: null, p192: null, p25519: null }; function M(t, e) { this.name = t; this.p = new o(e, 16); this.n = this.p.bitLength(); this.k = new o(1).iushln(this.n).isub(this.p); this.tmp = this._tmp(); } M.prototype._tmp = function t() { var e = new o(null); e.words = new Array(Math.ceil(this.n / 13)); return e; }; M.prototype.ireduce = function t(e) { var r = e; var n; do { this.split(r, this.tmp); r = this.imulK(r); r = r.iadd(this.tmp); n = r.bitLength(); }while (n > this.n) var i = n < this.n ? -1 : r.ucmp(this.p); if (i === 0) { r.words[0] = 0; r.length = 1; } else if (i > 0) { r.isub(this.p); } else { if (r.strip !== undefined) { r.strip(); } else { r._strip(); } } return r; }; M.prototype.split = function t(e, r) { e.iushrn(this.n, 0, r); }; M.prototype.imulK = function t(e) { return e.imul(this.k); }; function T() { M.call(this, 'k256', 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); } i(T, M); T.prototype.split = function t(e, r) { var n = 0x3fffff; var i = Math.min(e.length, 9); for(var o = 0; o < i; o++){ r.words[o] = e.words[o]; } r.length = i; if (e.length <= 9) { e.words[0] = 0; e.length = 1; return; } var s = e.words[9]; r.words[r.length++] = s & n; for(o = 10; o < e.length; o++){ var a = e.words[o] | 0; e.words[o - 10] = ((a & n) << 4) | (s >>> 22); s = a; } s >>>= 22; e.words[o - 10] = s; if (s === 0 && e.length > 10) { e.length -= 10; } else { e.length -= 9; } }; T.prototype.imulK = function t(e) { e.words[e.length] = 0; e.words[e.length + 1] = 0; e.length += 2; var r = 0; for(var n = 0; n < e.length; n++){ var i = e.words[n] | 0; r += i * 0x3d1; e.words[n] = r & 0x3ffffff; r = i * 0x40 + ((r / 0x4000000) | 0); } if (e.words[e.length - 1] === 0) { e.length--; if (e.words[e.length - 1] === 0) { e.length--; } } return e; }; function A() { M.call(this, 'p224', 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); } i(A, M); function O() { M.call(this, 'p192', 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); } i(O, M); function k() { M.call(this, '25519', '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); } i(k, M); k.prototype.imulK = function t(e) { var r = 0; for(var n = 0; n < e.length; n++){ var i = (e.words[n] | 0) * 0x13 + r; var o = i & 0x3ffffff; i >>>= 26; e.words[n] = o; r = i; } if (r !== 0) { e.words[e.length++] = r; } return e; }; o._prime = function t(e) { if (x[e]) return x[e]; var r; if (e === 'k256') { r = new T(); } else if (e === 'p224') { r = new A(); } else if (e === 'p192') { r = new O(); } else if (e === 'p25519') { r = new k(); } else { throw new Error('Unknown prime ' + e); } x[e] = r; return r; }; function I(t) { if (typeof t === 'string') { var e = o._prime(t); this.m = e.p; this.prime = e; } else { n(t.gtn(1), 'modulus must be greater than 1'); this.m = t; this.prime = null; } } I.prototype._verify1 = function t(e) { n(e.negative === 0, 'red works only with positives'); n(e.red, 'red works only with red numbers'); }; I.prototype._verify2 = function t(e, r) { n((e.negative | r.negative) === 0, 'red works only with positives'); n(e.red && e.red === r.red, 'red works only with red numbers'); }; I.prototype.imod = function t(e) { if (this.prime) return this.prime.ireduce(e)._forceRed(this); l(e, e.umod(this.m)._forceRed(this)); return e; }; I.prototype.neg = function t(e) { if (e.isZero()) { return e.clone(); } return this.m.sub(e)._forceRed(this); }; I.prototype.add = function t(e, r) { this._verify2(e, r); var n = e.add(r); if (n.cmp(this.m) >= 0) { n.isub(this.m); } return n._forceRed(this); }; I.prototype.iadd = function t(e, r) { this._verify2(e, r); var n = e.iadd(r); if (n.cmp(this.m) >= 0) { n.isub(this.m); } return n; }; I.prototype.sub = function t(e, r) { this._verify2(e, r); var n = e.sub(r); if (n.cmpn(0) < 0) { n.iadd(this.m); } return n._forceRed(this); }; I.prototype.isub = function t(e, r) { this._verify2(e, r); var n = e.isub(r); if (n.cmpn(0) < 0) { n.iadd(this.m); } return n; }; I.prototype.shl = function t(e, r) { this._verify1(e); return this.imod(e.ushln(r)); }; I.prototype.imul = function t(e, r) { this._verify2(e, r); return this.imod(e.imul(r)); }; I.prototype.mul = function t(e, r) { this._verify2(e, r); return this.imod(e.mul(r)); }; I.prototype.isqr = function t(e) { return this.imul(e, e.clone()); }; I.prototype.sqr = function t(e) { return this.mul(e, e); }; I.prototype.sqrt = function t(e) { if (e.isZero()) return e.clone(); var r = this.m.andln(3); n(r % 2 === 1); if (r === 3) { var i = this.m.add(new o(1)).iushrn(2); return this.pow(e, i); } var s = this.m.subn(1); var a = 0; while(!s.isZero() && s.andln(1) === 0){ a++; s.iushrn(1); } n(!s.isZero()); var f = new o(1).toRed(this); var u = f.redNeg(); var c = this.m.subn(1).iushrn(1); var l = this.m.bitLength(); l = new o(2 * l * l).toRed(this); while(this.pow(l, c).cmp(u) !== 0){ l.redIAdd(u); } var h = this.pow(l, s); var d = this.pow(e, s.addn(1).iushrn(1)); var p = this.pow(e, s); var g = a; while(p.cmp(f) !== 0){ var b = p; for(var v = 0; b.cmp(f) !== 0; v++){ b = b.redSqr(); } n(v < g); var y = this.pow(h, new o(1).iushln(g - v - 1)); d = d.redMul(y); h = y.redSqr(); p = p.redMul(h); g = v; } return d; }; I.prototype.invm = function t(e) { var r = e._invmp(this.m); if (r.negative !== 0) { r.negative = 0; return this.imod(r).redNeg(); } else { return this.imod(r); } }; I.prototype.pow = function t(e, r) { if (r.isZero()) return new o(1).toRed(this); if (r.cmpn(1) === 0) return e.clone(); var n = 4; var i = new Array(1 << n); i[0] = new o(1).toRed(this); i[1] = e; for(var s = 2; s < i.length; s++){ i[s] = this.mul(i[s - 1], e); } var a = i[0]; var f = 0; var u = 0; var c = r.bitLength() % 26; if (c === 0) { c = 26; } for(s = r.length - 1; s >= 0; s--){ var l = r.words[s]; for(var h = c - 1; h >= 0; h--){ var d = (l >> h) & 1; if (a !== i[0]) { a = this.sqr(a); } if (d === 0 && f === 0) { u = 0; continue; } f <<= 1; f |= d; u++; if (u !== n && (s !== 0 || h !== 0)) continue; a = this.mul(a, i[f]); u = 0; f = 0; } c = 26; } return a; }; I.prototype.convertTo = function t(e) { var r = e.umod(this.m); return r === e ? r.clone() : r; }; I.prototype.convertFrom = function t(e) { var r = e.clone(); r.red = null; return r; }; o.mont = function t(e) { return new R(e); }; function R(t) { I.call(this, t); this.shift = this.m.bitLength(); if (this.shift % 26 !== 0) { this.shift += 26 - (this.shift % 26); } this.r = new o(1).iushln(this.shift); this.r2 = this.imod(this.r.sqr()); this.rinv = this.r._invmp(this.m); this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); this.minv = this.minv.umod(this.r); this.minv = this.r.sub(this.minv); } i(R, I); R.prototype.convertTo = function t(e) { return this.imod(e.ushln(this.shift)); }; R.prototype.convertFrom = function t(e) { var r = this.imod(e.mul(this.rinv)); r.red = null; return r; }; R.prototype.imul = function t(e, r) { if (e.isZero() || r.isZero()) { e.words[0] = 0; e.length = 1; return e; } var n = e.imul(r); var i = n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); var o = n.isub(i).iushrn(this.shift); var s = o; if (o.cmp(this.m) >= 0) { s = o.isub(this.m); } else if (o.cmpn(0) < 0) { s = o.iadd(this.m); } return s._forceRed(this); }; R.prototype.mul = function t(e, r) { if (e.isZero() || r.isZero()) return new o(0)._forceRed(this); var n = e.mul(r); var i = n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); var s = n.isub(i).iushrn(this.shift); var a = s; if (s.cmp(this.m) >= 0) { a = s.isub(this.m); } else if (s.cmpn(0) < 0) { a = s.iadd(this.m); } return a._forceRed(this); }; R.prototype.invm = function t(e) { var r = this.imod(e._invmp(this.m).mul(this.r2)); return r._forceRed(this); }; })(false || t, this); }), 9464: (function(t, e, r) { "use strict"; const { fromCallback: n } = r(6957); const i = r(4473); const { getCallback: o , getOptions: s } = r(2520); const a = Symbol('promise'); const f = Symbol('status'); const u = Symbol('operations'); const c = Symbol('finishClose'); const l = Symbol('closeCallbacks'); class h { constructor(t){ if (typeof t !== 'object' || t === null) { const e = t === null ? 'null' : typeof t; throw new TypeError(`The first argument must be an abstract-level database, received ${e}`); } this[u] = []; this[l] = []; this[f] = 'open'; this[c] = this[c].bind(this); this.db = t; this.db.attachResource(this); this.nextTick = t.nextTick; } get length() { return this[u].length; } put(t, e, r) { if (this[f] !== 'open') { throw new i('Batch is not open: cannot call put() after write() or close()', { code: 'LEVEL_BATCH_NOT_OPEN' }); } const n = this.db._checkKey(t) || this.db._checkValue(e); if (n) throw n; const o = r && r.sublevel != null ? r.sublevel : this.db; const s = r; const a = o.keyEncoding(r && r.keyEncoding); const c = o.valueEncoding(r && r.valueEncoding); const l = a.format; r = { ...r, keyEncoding: l, valueEncoding: c.format }; if (o !== this.db) { r.sublevel = null; } const h = o.prefixKey(a.encode(t), l); const d = c.encode(e); this._put(h, d, r); this[u].push({ ...s, type: 'put', key: t, value: e }); return this; } _put(t, e, r) {} del(t, e) { if (this[f] !== 'open') { throw new i('Batch is not open: cannot call del() after write() or close()', { code: 'LEVEL_BATCH_NOT_OPEN' }); } const r = this.db._checkKey(t); if (r) throw r; const n = e && e.sublevel != null ? e.sublevel : this.db; const o = e; const s = n.keyEncoding(e && e.keyEncoding); const a = s.format; e = { ...e, keyEncoding: a }; if (n !== this.db) { e.sublevel = null; } this._del(n.prefixKey(s.encode(t), a), e); this[u].push({ ...o, type: 'del', key: t }); return this; } _del(t, e) {} clear() { if (this[f] !== 'open') { throw new i('Batch is not open: cannot call clear() after write() or close()', { code: 'LEVEL_BATCH_NOT_OPEN' }); } this._clear(); this[u] = []; return this; } _clear() {} write(t, e) { e = o(t, e); e = n(e, a); t = s(t); if (this[f] !== 'open') { this.nextTick(e, new i('Batch is not open: cannot call write() after write() or close()', { code: 'LEVEL_BATCH_NOT_OPEN' })); } else if (this.length === 0) { this.close(e); } else { this[f] = 'writing'; this._write(t, (t)=>{ this[f] = 'closing'; this[l].push(()=>e(t)); if (!t) this.db.emit('batch', this[u]); this._close(this[c]); }); } return e[a]; } _write(t, e) {} close(t) { t = n(t, a); if (this[f] === 'closing') { this[l].push(t); } else if (this[f] === 'closed') { this.nextTick(t); } else { this[l].push(t); if (this[f] !== 'writing') { this[f] = 'closing'; this._close(this[c]); } } return t[a]; } _close(t) { this.nextTick(t); } [c]() { this[f] = 'closed'; this.db.detachResource(this); const t = this[l]; this[l] = []; for (const e of t){ e(); } } } e.AbstractChainedBatch = h; }), 3961: (function(t, e, r) { "use strict"; const { fromCallback: n } = r(6957); const i = r(4473); const { getOptions: o , getCallback: s } = r(2520); const a = Symbol('promise'); const f = Symbol('callback'); const u = Symbol('working'); const c = Symbol('handleOne'); const l = Symbol('handleMany'); const h = Symbol('autoClose'); const d = Symbol('finishWork'); const p = Symbol('returnMany'); const g = Symbol('closing'); const b = Symbol('handleClose'); const v = Symbol('closed'); const y = Symbol('closeCallbacks'); const m = Symbol('keyEncoding'); const w = Symbol('valueEncoding'); const _ = Symbol('abortOnClose'); const S = Symbol('legacy'); const E = Symbol('keys'); const x = Symbol('values'); const M = Symbol('limit'); const T = Symbol('count'); const A = Object.freeze({}); const O = ()=>{}; let k = false; class I { constructor(t, e, r){ if (typeof t !== 'object' || t === null) { const n = t === null ? 'null' : typeof t; throw new TypeError(`The first argument must be an abstract-level database, received ${n}`); } if (typeof e !== 'object' || e === null) { throw new TypeError('The second argument must be an options object'); } this[v] = false; this[y] = []; this[u] = false; this[g] = false; this[h] = false; this[f] = null; this[c] = this[c].bind(this); this[l] = this[l].bind(this); this[b] = this[b].bind(this); this[m] = e[m]; this[w] = e[w]; this[S] = r; this[M] = Number.isInteger(e.limit) && e.limit >= 0 ? e.limit : Infinity; this[T] = 0; this[_] = !!e.abortOnClose; this.db = t; this.db.attachResource(this); this.nextTick = t.nextTick; } get count() { return this[T]; } get limit() { return this[M]; } next(t) { let e; if (t === undefined) { e = new Promise((e, r)=>{ t = (t, n, i)=>{ if (t) r(t); else if (!this[S]) e(n); else if (n === undefined && i === undefined) e(); else e([ n, i ]); }; }); } else if (typeof t !== 'function') { throw new TypeError('Callback must be a function'); } if (this[g]) { this.nextTick(t, new i('Iterator is not open: cannot call next() after close()', { code: 'LEVEL_ITERATOR_NOT_OPEN' })); } else if (this[u]) { this.nextTick(t, new i('Iterator is busy: cannot call next() until previous call has completed', { code: 'LEVEL_ITERATOR_BUSY' })); } else { this[u] = true; this[f] = t; if (this[T] >= this[M]) this.nextTick(this[c], null); else this._next(this[c]); } return e; } _next(t) { this.nextTick(t); } nextv(t, e, r) { r = s(e, r); r = n(r, a); e = o(e, A); if (!Number.isInteger(t)) { this.nextTick(r, new TypeError("The first argument 'size' must be an integer")); return r[a]; } if (this[g]) { this.nextTick(r, new i('Iterator is not open: cannot call nextv() after close()', { code: 'LEVEL_ITERATOR_NOT_OPEN' })); } else if (this[u]) { this.nextTick(r, new i('Iterator is busy: cannot call nextv() until previous call has completed', { code: 'LEVEL_ITERATOR_BUSY' })); } else { if (t < 1) t = 1; if (this[M] < Infinity) t = Math.min(t, this[M] - this[T]); this[u] = true; this[f] = r; if (t <= 0) this.nextTick(this[l], null, []); else this._nextv(t, e, this[l]); } return r[a]; } _nextv(t, e, r) { const n = []; const i = (e, o, s)=>{ if (e) { return r(e); } else if (this[S] ? o === undefined && s === undefined : o === undefined) { return r(null, n); } n.push(this[S] ? [ o, s ] : o); if (n.length === t) { r(null, n); } else { this._next(i); } }; this._next(i); } all(t, e) { e = s(t, e); e = n(e, a); t = o(t, A); if (this[g]) { this.nextTick(e, new i('Iterator is not open: cannot call all() after close()', { code: 'LEVEL_ITERATOR_NOT_OPEN' })); } else if (this[u]) { this.nextTick(e, new i('Iterator is busy: cannot call all() until previous call has completed', { code: 'LEVEL_ITERATOR_BUSY' })); } else { this[u] = true; this[f] = e; this[h] = true; if (this[T] >= this[M]) this.nextTick(this[l], null, []); else this._all(t, this[l]); } return e[a]; } _all(t, e) { let r = this[T]; const n = []; const i = ()=>{ const t = this[M] < Infinity ? Math.min(1e3, this[M] - r) : 1e3; if (t <= 0) { this.nextTick(e, null, n); } else { this._nextv(t, A, o); } }; const o = (t, o)=>{ if (t) { e(t); } else if (o.length === 0) { e(null, n); } else { n.push.apply(n, o); r += o.length; i(); } }; i(); } [d]() { const t = this[f]; if (this[_] && t === null) return O; this[u] = false; this[f] = null; if (this[g]) this._close(this[b]); return t; } [p](t, e, r) { if (this[h]) { this.close(t.bind(null, e, r)); } else { t(e, r); } } seek(t, e) { e = o(e, A); if (this[g]) {} else if (this[u]) { throw new i('Iterator is busy: cannot call seek() until next() has completed', { code: 'LEVEL_ITERATOR_BUSY' }); } else { const r = this.db.keyEncoding(e.keyEncoding || this[m]); const n = r.format; if (e.keyEncoding !== n) { e = { ...e, keyEncoding: n }; } const s = this.db.prefixKey(r.encode(t), n); this._seek(s, e); } } _seek(t, e) { throw new i('Iterator does not support seek()', { code: 'LEVEL_NOT_SUPPORTED' }); } close(t) { t = n(t, a); if (this[v]) { this.nextTick(t); } else if (this[g]) { this[y].push(t); } else { this[g] = true; this[y].push(t); if (!this[u]) { this._close(this[b]); } else if (this[_]) { const e = this[d](); e(new i('Aborted on iterator close()', { code: 'LEVEL_ITERATOR_NOT_OPEN' })); } } return t[a]; } _close(t) { this.nextTick(t); } [b]() { this[v] = true; this.db.detachResource(this); const t = this[y]; this[y] = []; for (const e of t){ e(); } } async *[Symbol.asyncIterator]() { try { let t; while((t = (await this.next())) !== undefined){ yield t; } } finally{ if (!this[v]) await this.close(); } } } class R extends I { constructor(t, e){ super(t, e, true); this[E] = e.keys !== false; this[x] = e.values !== false; } [c](t, e, r) { const n = this[d](); if (t) return n(t); try { e = this[E] && e !== undefined ? this[m].decode(e) : undefined; r = this[x] && r !== undefined ? this[w].decode(r) : undefined; } catch (i) { return n(new P('entry', i)); } if (!(e === undefined && r === undefined)) { this[T]++; } n(null, e, r); } [l](t, e) { const r = this[d](); if (t) return this[p](r, t); try { for (const n of e){ const i = n[0]; const o = n[1]; n[0] = this[E] && i !== undefined ? this[m].decode(i) : undefined; n[1] = this[x] && o !== undefined ? this[w].decode(o) : undefined; } } catch (s) { return this[p](r, new P('entries', s)); } this[T] += e.length; this[p](r, null, e); } end(t) { if (!k && typeof console !== 'undefined') { k = true; console.warn(new i('The iterator.end() method was renamed to close() and end() is an alias that will be removed in a future version', { code: 'LEVEL_LEGACY' })); } return this.close(t); } } class N extends I { constructor(t, e){ super(t, e, false); } [c](t, e) { const r = this[d](); if (t) return r(t); try { e = e !== undefined ? this[m].decode(e) : undefined; } catch (n) { return r(new P('key', n)); } if (e !== undefined) this[T]++; r(null, e); } [l](t, e) { const r = this[d](); if (t) return this[p](r, t); try { for(let n = 0; n < e.length; n++){ const i = e[n]; e[n] = i !== undefined ? this[m].decode(i) : undefined; } } catch (o) { return this[p](r, new P('keys', o)); } this[T] += e.length; this[p](r, null, e); } } class j extends I { constructor(t, e){ super(t, e, false); } [c](t, e) { const r = this[d](); if (t) return r(t); try { e = e !== undefined ? this[w].decode(e) : undefined; } catch (n) { return r(new P('value', n)); } if (e !== undefined) this[T]++; r(null, e); } [l](t, e) { const r = this[d](); if (t) return this[p](r, t); try { for(let n = 0; n < e.length; n++){ const i = e[n]; e[n] = i !== undefined ? this[w].decode(i) : undefined; } } catch (o) { return this[p](r, new P('values', o)); } this[T] += e.length; this[p](r, null, e); } } class P extends i { constructor(t, e){ super(`Iterator could not decode ${t}`, { code: 'LEVEL_DECODE_ERROR', cause: e }); } } for (const C of [ '_ended property', '_nexting property', '_end method' ]){ Object.defineProperty(R.prototype, C.split(' ')[0], { get () { throw new i(`The ${C} has been removed`, { code: 'LEVEL_LEGACY' }); }, set () { throw new i(`The ${C} has been removed`, { code: 'LEVEL_LEGACY' }); } }); } R.keyEncoding = m; R.valueEncoding = w; e.AbstractIterator = R; e.AbstractKeyIterator = N; e.AbstractValueIterator = j; }), 9071: (function(t, e, r) { "use strict"; const { supports: n } = r(1675); const { Transcoder: i } = r(8499); const { EventEmitter: o } = r(7187); const { fromCallback: s } = r(6957); const a = r(4473); const { AbstractIterator: f } = r(3961); const { DefaultKeyIterator: u , DefaultValueIterator: c } = r(5429); const { DeferredIterator: l , DeferredKeyIterator: h , DeferredValueIterator: d } = r(593); const { DefaultChainedBatch: p } = r(4765); const { getCallback: g , getOptions: b } = r(2520); const v = r(56); const y = Symbol('promise'); const m = Symbol('landed'); const w = Symbol('resources'); const _ = Symbol('closeResources'); const S = Symbol('operations'); const E = Symbol('undefer'); const x = Symbol('deferOpen'); const M = Symbol('options'); const T = Symbol('status'); const A = Symbol('defaultOptions'); const O = Symbol('transcoder'); const k = Symbol('keyEncoding'); const I = Symbol('valueEncoding'); const R = ()=>{}; class N extends o { constructor(t, e){ super(); if (typeof t !== 'object' || t === null) { throw new TypeError("The first argument 'manifest' must be an object"); } e = b(e); const { keyEncoding: r , valueEncoding: o , passive: s , ...a } = e; this[w] = new Set(); this[S] = []; this[x] = true; this[M] = a; this[T] = 'opening'; this.supports = n(t, { status: true, promises: true, clear: true, getMany: true, deferredOpen: true, snapshots: t.snapshots !== false, permanence: t.permanence !== false, keyIterator: true, valueIterator: true, iteratorNextv: true, iteratorAll: true, encodings: t.encodings || {}, events: Object.assign({}, t.events, { opening: true, open: true, closing: true, closed: true, put: true, del: true, batch: true, clear: true }) }); this[O] = new i(C(this)); this[k] = this[O].encoding(r || 'utf8'); this[I] = this[O].encoding(o || 'utf8'); for (const f of this[O].encodings()){ if (!this.supports.encodings[f.commonName]) { this.supports.encodings[f.commonName] = true; } } this[A] = { empty: Object.freeze({}), entry: Object.freeze({ keyEncoding: this[k].commonName, valueEncoding: this[I].commonName }), key: Object.freeze({ keyEncoding: this[k].commonName }) }; this.nextTick(()=>{ if (this[x]) { this.open({ passive: false }, R); } }); } get status() { return this[T]; } keyEncoding(t) { return this[O].encoding(t != null ? t : this[k]); } valueEncoding(t) { return this[O].encoding(t != null ? t : this[I]); } open(t, e) { e = g(t, e); e = s(e, y); t = { ...this[M], ...b(t) }; t.createIfMissing = t.createIfMissing !== false; t.errorIfExists = !!t.errorIfExists; const r = (t)=>{ if (this[T] === 'closing' || this[T] === 'opening') { this.once(m, t ? ()=>r(t) : r); } else if (this[T] !== 'open') { e(new a('Database is not open', { code: 'LEVEL_DATABASE_NOT_OPEN', cause: t })); } else { e(); } }; if (t.passive) { if (this[T] === 'opening') { this.once(m, r); } else { this.nextTick(r); } } else if (this[T] === 'closed' || this[x]) { this[x] = false; this[T] = 'opening'; this.emit('opening'); this._open(t, (t)=>{ if (t) { this[T] = 'closed'; this[_](()=>{ this.emit(m); r(t); }); this[E](); return; } this[T] = 'open'; this[E](); this.emit(m); if (this[T] === 'open') this.emit('open'); if (this[T] === 'open') this.emit('ready'); r(); }); } else if (this[T] === 'open') { this.nextTick(r); } else { this.once(m, ()=>this.open(t, e)); } return e[y]; } _open(t, e) { this.nextTick(e); } close(t) { t = s(t, y); const e = (r)=>{ if (this[T] === 'opening' || this[T] === 'closing') { this.once(m, r ? e(r) : e); } else if (this[T] !== 'closed') { t(new a('Database is not closed', { code: 'LEVEL_DATABASE_NOT_CLOSED', cause: r })); } else { t(); } }; if (this[T] === 'open') { this[T] = 'closing'; this.emit('closing'); const r = (t)=>{ this[T] = 'open'; this[E](); this.emit(m); e(t); }; this[_](()=>{ this._close((t)=>{ if (t) return r(t); this[T] = 'closed'; this[E](); this.emit(m); if (this[T] === 'closed') this.emit('closed'); e(); }); }); } else if (this[T] === 'closed') { this.nextTick(e); } else { this.once(m, ()=>this.close(t)); } return t[y]; } [_](t) { if (this[w].size === 0) { return this.nextTick(t); } let e = this[w].size; let r = true; const n = ()=>{ if (--e === 0) { if (r) this.nextTick(t); else t(); } }; for (const i of this[w]){ i.close(n); } r = false; this[w].clear(); } _close(t) { this.nextTick(t); } get(t, e, r) { r = g(e, r); r = s(r, y); e = b(e, this[A].entry); if (this[T] === 'opening') { this.defer(()=>this.get(t, e, r)); return r[y]; } if (P(this, r)) { return r[y]; } const n = this._checkKey(t); if (n) { this.nextTick(r, n); return r[y]; } const i = this.keyEncoding(e.keyEncoding); const o = this.valueEncoding(e.valueEncoding); const f = i.format; const u = o.format; if (e.keyEncoding !== f || e.valueEncoding !== u) { e = Object.assign({}, e, { keyEncoding: f, valueEncoding: u }); } this._get(this.prefixKey(i.encode(t), f), e, (t, e)=>{ if (t) { if (t.code === 'LEVEL_NOT_FOUND' || t.notFound || /NotFound/i.test(t)) { if (!t.code) t.code = 'LEVEL_NOT_FOUND'; if (!t.notFound) t.notFound = true; if (!t.status) t.status = 404; } return r(t); } try { e = o.decode(e); } catch (n) { return r(new a('Could not decode value', { code: 'LEVEL_DECODE_ERROR', cause: n })); } r(null, e); }); return r[y]; } _get(t, e, r) { this.nextTick(r, new Error('NotFound')); } getMany(t, e, r) { r = g(e, r); r = s(r, y); e = b(e, this[A].entry); if (this[T] === 'opening') { this.defer(()=>this.getMany(t, e, r)); return r[y]; } if (P(this, r)) { return r[y]; } if (!Array.isArray(t)) { this.nextTick(r, new TypeError("The first argument 'keys' must be an array")); return r[y]; } if (t.length === 0) { this.nextTick(r, null, []); return r[y]; } const n = this.keyEncoding(e.keyEncoding); const i = this.valueEncoding(e.valueEncoding); const o = n.format; const f = i.format; if (e.keyEncoding !== o || e.valueEncoding !== f) { e = Object.assign({}, e, { keyEncoding: o, valueEncoding: f }); } const u = new Array(t.length); for(let c = 0; c < t.length; c++){ const l = t[c]; const h = this._checkKey(l); if (h) { this.nextTick(r, h); return r[y]; } u[c] = this.prefixKey(n.encode(l), o); } this._getMany(u, e, (t, e)=>{ if (t) return r(t); try { for(let n = 0; n < e.length; n++){ if (e[n] !== undefined) { e[n] = i.decode(e[n]); } } } catch (o) { return r(new a(`Could not decode one or more of ${e.length} value(s)`, { code: 'LEVEL_DECODE_ERROR', cause: o })); } r(null, e); }); return r[y]; } _getMany(t, e, r) { this.nextTick(r, null, new Array(t.length).fill(undefined)); } put(t, e, r, n) { n = g(r, n); n = s(n, y); r = b(r, this[A].entry); if (this[T] === 'opening') { this.defer(()=>this.put(t, e, r, n)); return n[y]; } if (P(this, n)) { return n[y]; } const i = this._checkKey(t) || this._checkValue(e); if (i) { this.nextTick(n, i); return n[y]; } const o = this.keyEncoding(r.keyEncoding); const a = this.valueEncoding(r.valueEncoding); const f = o.format; const u = a.format; if (r.keyEncoding !== f || r.valueEncoding !== u) { r = Object.assign({}, r, { keyEncoding: f, valueEncoding: u }); } const c = this.prefixKey(o.encode(t), f); const l = a.encode(e); this._put(c, l, r, (r)=>{ if (r) return n(r); this.emit('put', t, e); n(); }); return n[y]; } _put(t, e, r, n) { this.nextTick(n); } del(t, e, r) { r = g(e, r); r = s(r, y); e = b(e, this[A].key); if (this[T] === 'opening') { this.defer(()=>this.del(t, e, r)); return r[y]; } if (P(this, r)) { return r[y]; } const n = this._checkKey(t); if (n) { this.nextTick(r, n); return r[y]; } const i = this.keyEncoding(e.keyEncoding); const o = i.format; if (e.keyEncoding !== o) { e = Object.assign({}, e, { keyEncoding: o }); } this._del(this.prefixKey(i.encode(t), o), e, (e)=>{ if (e) return r(e); this.emit('del', t); r(); }); return r[y]; } _del(t, e, r) { this.nextTick(r); } batch(t, e, r) { if (!arguments.length) { if (this[T] === 'opening') return new p(this); if (this[T] !== 'open') { throw new a('Database is not open', { code: 'LEVEL_DATABASE_NOT_OPEN' }); } return this._chainedBatch(); } if (typeof t === 'function') r = t; else r = g(e, r); r = s(r, y); e = b(e, this[A].empty); if (this[T] === 'opening') { this.defer(()=>this.batch(t, e, r)); return r[y]; } if (P(this, r)) { return r[y]; } if (!Array.isArray(t)) { this.nextTick(r, new TypeError("The first argument 'operations' must be an array")); return r[y]; } if (t.length === 0) { this.nextTick(r); return r[y]; } const n = new Array(t.length); const { keyEncoding: i , valueEncoding: o , ...f } = e; for(let u = 0; u < t.length; u++){ if (typeof t[u] !== 'object' || t[u] === null) { this.nextTick(r, new TypeError('A batch operation must be an object')); return r[y]; } const c = Object.assign({}, t[u]); if (c.type !== 'put' && c.type !== 'del') { this.nextTick(r, new TypeError("A batch operation must have a type property that is 'put' or 'del'")); return r[y]; } const l = this._checkKey(c.key); if (l) { this.nextTick(r, l); return r[y]; } const h = c.sublevel != null ? c.sublevel : this; const d = h.keyEncoding(c.keyEncoding || i); const v = d.format; c.key = h.prefixKey(d.encode(c.key), v); c.keyEncoding = v; if (c.type === 'put') { const m = this._checkValue(c.value); if (m) { this.nextTick(r, m); return r[y]; } const w = h.valueEncoding(c.valueEncoding || o); c.value = w.encode(c.value); c.valueEncoding = w.format; } if (h !== this) { c.sublevel = null; } n[u] = c; } this._batch(n, f, (e)=>{ if (e) return r(e); this.emit('batch', t); r(); }); return r[y]; } _batch(t, e, r) { this.nextTick(r); } sublevel(t, e) { return this._sublevel(t, j.defaults(e)); } _sublevel(t, e) { return new j(this, t, e); } prefixKey(t, e) { return t; } clear(t, e) { e = g(t, e); e = s(e, y); t = b(t, this[A].empty); if (this[T] === 'opening') { this.defer(()=>this.clear(t, e)); return e[y]; } if (P(this, e)) { return e[y]; } const r = t; const n = this.keyEncoding(t.keyEncoding); t = v(t, n); t.keyEncoding = n.format; if (t.limit === 0) { this.nextTick(e); } else { this._clear(t, (t)=>{ if (t) return e(t); this.emit('clear', r); e(); }); } return e[y]; } _clear(t, e) { this.nextTick(e); } iterator(t) { const e = this.keyEncoding(t && t.keyEncoding); const r = this.valueEncoding(t && t.valueEncoding); t = v(t, e); t.keys = t.keys !== false; t.values = t.values !== false; t[f.keyEncoding] = e; t[f.valueEncoding] = r; t.keyEncoding = e.format; t.valueEncoding = r.format; if (this[T] === 'opening') { return new l(this, t); } else if (this[T] !== 'open') { throw new a('Database is not open', { code: 'LEVEL_DATABASE_NOT_OPEN' }); } return this._iterator(t); } _iterator(t) { return new f(this, t); } keys(t) { const e = this.keyEncoding(t && t.keyEncoding); const r = this.valueEncoding(t && t.valueEncoding); t = v(t, e); t[f.keyEncoding] = e; t[f.valueEncoding] = r; t.keyEncoding = e.format; t.valueEncoding = r.format; if (this[T] === 'opening') { return new h(this, t); } else if (this[T] !== 'open') { throw new a('Database is not open', { code: 'LEVEL_DATABASE_NOT_OPEN' }); } return this._keys(t); } _keys(t) { return new u(this, t); } values(t) { const e = this.keyEncoding(t && t.keyEncoding); const r = this.valueEncoding(t && t.valueEncoding); t = v(t, e); t[f.keyEncoding] = e; t[f.valueEncoding] = r; t.keyEncoding = e.format; t.valueEncoding = r.format; if (this[T] === 'opening') { return new d(this, t); } else if (this[T] !== 'open') { throw new a('Database is not open', { code: 'LEVEL_DATABASE_NOT_OPEN' }); } return this._values(t); } _values(t) { return new c(this, t); } defer(t) { if (typeof t !== 'function') { throw new TypeError('The first argument must be a function'); } this[S].push(t); } [E]() { if (this[S].length === 0) { return; } const t = this[S]; this[S] = []; for (const e of t){ e(); } } attachResource(t) { if (typeof t !== 'object' || t === null || typeof t.close !== 'function') { throw new TypeError('The first argument must be a resource object'); } this[w].add(t); } detachResource(t) { this[w].delete(t); } _chainedBatch() { return new p(this); } _checkKey(t) { if (t === null || t === undefined) { return new a('Key cannot be null or undefined', { code: 'LEVEL_INVALID_KEY' }); } } _checkValue(t) { if (t === null || t === undefined) { return new a('Value cannot be null or undefined', { code: 'LEVEL_INVALID_VALUE' }); } } } N.prototype.nextTick = r(6909); const { AbstractSublevel: j } = r(9650)({ AbstractLevel: N }); e.AbstractLevel = N; e.AbstractSublevel = j; const P = function(t, e) { if (t[T] !== 'open') { t.nextTick(e, new a('Database is not open', { code: 'LEVEL_DATABASE_NOT_OPEN' })); return true; } return false; }; const C = function(t) { return Object.keys(t.supports.encodings).filter((e)=>!!t.supports.encodings[e]); }; }), 875: (function(t, e, r) { "use strict"; e.AbstractLevel = r(9071).AbstractLevel; e.AbstractSublevel = r(9071).AbstractSublevel; e.AbstractIterator = r(3961).AbstractIterator; e.AbstractKeyIterator = r(3961).AbstractKeyIterator; e.AbstractValueIterator = r(3961).AbstractValueIterator; e.AbstractChainedBatch = r(9464).AbstractChainedBatch; }), 2970: (function(t, e, r) { "use strict"; const { AbstractIterator: n , AbstractKeyIterator: i , AbstractValueIterator: o } = r(3961); const s = Symbol('unfix'); const a = Symbol('iterator'); const f = Symbol('handleOne'); const u = Symbol('handleMany'); const c = Symbol('callback'); class l extends n { constructor(t, e, r, n){ super(t, e); this[a] = r; this[s] = n; this[f] = this[f].bind(this); this[u] = this[u].bind(this); this[c] = null; } [f](t, e, r) { const n = this[c]; if (t) return n(t); if (e !== undefined) e = this[s](e); n(t, e, r); } [u](t, e) { const r = this[c]; if (t) return r(t); for (const n of e){ const i = n[0]; if (i !== undefined) n[0] = this[s](i); } r(t, e); } } class h extends i { constructor(t, e, r, n){ super(t, e); this[a] = r; this[s] = n; this[f] = this[f].bind(this); this[u] = this[u].bind(this); this[c] = null; } [f](t, e) { const r = this[c]; if (t) return r(t); if (e !== undefined) e = this[s](e); r(t, e); } [u](t, e) { const r = this[c]; if (t) return r(t); for(let n = 0; n < e.length; n++){ const i = e[n]; if (i !== undefined) e[n] = this[s](i); } r(t, e); } } class d extends o { constructor(t, e, r){ super(t, e); this[a] = r; } } for (const p of [ l, h ]){ p.prototype._next = function(t) { this[c] = t; this[a].next(this[f]); }; p.prototype._nextv = function(t, e, r) { this[c] = r; this[a].nextv(t, e, this[u]); }; p.prototype._all = function(t, e) { this[c] = e; this[a].all(t, this[u]); }; } for (const g of [ d ]){ g.prototype._next = function(t) { this[a].next(t); }; g.prototype._nextv = function(t, e, r) { this[a].nextv(t, e, r); }; g.prototype._all = function(t, e) { this[a].all(t, e); }; } for (const b of [ l, h, d ]){ b.prototype._seek = function(t, e) { this[a].seek(t, e); }; b.prototype._close = function(t) { this[a].close(t); }; } e.AbstractSublevelIterator = l; e.AbstractSublevelKeyIterator = h; e.AbstractSublevelValueIterator = d; }), 9650: (function(t, e, r) { "use strict"; const n = r(4473); const { Buffer: i } = r(8764) || {}; const { AbstractSublevelIterator: o , AbstractSublevelKeyIterator: s , AbstractSublevelValueIterator: a } = r(2970); const f = Symbol('prefix'); const u = Symbol('upperBound'); const c = Symbol('prefixRange'); const l = Symbol('parent'); const h = Symbol('unfix'); const d = new TextEncoder(); const p = { separator: '!' }; t.exports = function({ AbstractLevel: t }) { class e extends t { static defaults(t) { if (typeof t === 'string') { throw new n('The subleveldown string shorthand for { separator } has been removed', { code: 'LEVEL_LEGACY' }); } else if (t && t.open) { throw new n('The subleveldown open option has been removed', { code: 'LEVEL_LEGACY' }); } if (t == null) { return p; } else if (!t.separator) { return { ...t, separator: '!' }; } else { return t; } } constructor(t, r, i){ const { separator: o , manifest: s , ...a } = e.defaults(i); r = m(r, o); const c = o.charCodeAt(0) + 1; const p = t[l] || t; if (!d.encode(r).every((t)=>t > c && t < 127)) { throw new n(`Prefix must use bytes > ${c} < ${127}`, { code: 'LEVEL_INVALID_PREFIX' }); } super(g(p, s), a); const b = (t.prefix || '') + o + r + o; const w = b.slice(0, -1) + String.fromCharCode(c); this[l] = p; this[f] = new v(b); this[u] = new v(w); this[h] = new y(); this.nextTick = p.nextTick; } prefixKey(t, e) { if (e === 'utf8') { return this[f].utf8 + t; } else if (t.byteLength === 0) { return this[f][e]; } else if (e === 'view') { const r = this[f].view; const n = new Uint8Array(r.byteLength + t.byteLength); n.set(r, 0); n.set(t, r.byteLength); return n; } else { const o = this[f].buffer; return i.concat([ o, t ], o.byteLength + t.byteLength); } } [c](t, e) { if (t.gte !== undefined) { t.gte = this.prefixKey(t.gte, e); } else if (t.gt !== undefined) { t.gt = this.prefixKey(t.gt, e); } else { t.gte = this[f][e]; } if (t.lte !== undefined) { t.lte = this.prefixKey(t.lte, e); } else if (t.lt !== undefined) { t.lt = this.prefixKey(t.lt, e); } else { t.lte = this[u][e]; } } get prefix() { return this[f].utf8; } get db() { return this[l]; } _open(t, e) { this[l].open({ passive: true }, e); } _put(t, e, r, n) { this[l].put(t, e, r, n); } _get(t, e, r) { this[l].get(t, e, r); } _getMany(t, e, r) { this[l].getMany(t, e, r); } _del(t, e, r) { this[l].del(t, e, r); } _batch(t, e, r) { this[l].batch(t, e, r); } _clear(t, e) { this[c](t, t.keyEncoding); this[l].clear(t, e); } _iterator(t) { this[c](t, t.keyEncoding); const e = this[l].iterator(t); const r = this[h].get(this[f].utf8.length, t.keyEncoding); return new o(this, t, e, r); } _keys(t) { this[c](t, t.keyEncoding); const e = this[l].keys(t); const r = this[h].get(this[f].utf8.length, t.keyEncoding); return new s(this, t, e, r); } _values(t) { this[c](t, t.keyEncoding); const e = this[l].values(t); return new a(this, t, e); } } return { AbstractSublevel: e }; }; const g = function(t, e) { return { ...t.supports, createIfMissing: false, errorIfExists: false, events: {}, additionalMethods: {}, ...e, encodings: { utf8: b(t, 'utf8'), buffer: b(t, 'buffer'), view: b(t, 'view') } }; }; const b = function(t, e) { return t.supports.encodings[e] ? t.keyEncoding(e).name === e : false; }; class v { constructor(t){ this.utf8 = t; this.view = d.encode(t); this.buffer = i ? i.from(this.view.buffer, 0, this.view.byteLength) : {}; } } class y { constructor(){ this.cache = new Map(); } get(t, e) { let r = this.cache.get(e); if (r === undefined) { if (e === 'view') { r = function(t, e) { return e.subarray(t); }.bind(null, t); } else { r = function(t, e) { return e.slice(t); }.bind(null, t); } this.cache.set(e, r); } return r; } } const m = function(t, e) { let r = 0; let n = t.length; while(r < n && t[r] === e)r++; while(n > r && t[n - 1] === e)n--; return t.slice(r, n); }; }), 2520: (function(t, e) { "use strict"; e.getCallback = function(t, e) { return typeof t === 'function' ? t : e; }; e.getOptions = function(t, e) { if (typeof t === 'object' && t !== null) { return t; } if (e !== undefined) { return e; } return {}; }; }), 4765: (function(t, e, r) { "use strict"; const { AbstractChainedBatch: n } = r(9464); const i = r(4473); const o = Symbol('encoded'); class s extends n { constructor(t){ super(t); this[o] = []; } _put(t, e, r) { this[o].push({ ...r, type: 'put', key: t, value: e }); } _del(t, e) { this[o].push({ ...e, type: 'del', key: t }); } _clear() { this[o] = []; } _write(t, e) { if (this.db.status === 'opening') { this.db.defer(()=>this._write(t, e)); } else if (this.db.status === 'open') { if (this[o].length === 0) this.nextTick(e); else this.db._batch(this[o], t, e); } else { this.nextTick(e, new i('Batch is not open: cannot call write() after write() or close()', { code: 'LEVEL_BATCH_NOT_OPEN' })); } } } e.DefaultChainedBatch = s; }), 5429: (function(t, e, r) { "use strict"; const { AbstractKeyIterator: n , AbstractValueIterator: i } = r(3961); const o = Symbol('iterator'); const s = Symbol('callback'); const a = Symbol('handleOne'); const f = Symbol('handleMany'); class u extends n { constructor(t, e){ super(t, e); this[o] = t.iterator({ ...e, keys: true, values: false }); this[a] = this[a].bind(this); this[f] = this[f].bind(this); } } class c extends i { constructor(t, e){ super(t, e); this[o] = t.iterator({ ...e, keys: false, values: true }); this[a] = this[a].bind(this); this[f] = this[f].bind(this); } } for (const l of [ u, c ]){ const h = l === u; const d = h ? (t)=>t[0] : (t)=>t[1]; l.prototype._next = function(t) { this[s] = t; this[o].next(this[a]); }; l.prototype[a] = function(t, e, r) { const n = this[s]; if (t) n(t); else n(null, h ? e : r); }; l.prototype._nextv = function(t, e, r) { this[s] = r; this[o].nextv(t, e, this[f]); }; l.prototype._all = function(t, e) { this[s] = e; this[o].all(t, this[f]); }; l.prototype[f] = function(t, e) { const r = this[s]; if (t) r(t); else r(null, e.map(d)); }; l.prototype._seek = function(t, e) { this[o].seek(t, e); }; l.prototype._close = function(t) { this[o].close(t); }; } e.DefaultKeyIterator = u; e.DefaultValueIterator = c; }), 593: (function(t, e, r) { "use strict"; const { AbstractIterator: n , AbstractKeyIterator: i , AbstractValueIterator: o } = r(3961); const s = r(4473); const a = Symbol('nut'); const f = Symbol('undefer'); const u = Symbol('factory'); class c extends n { constructor(t, e){ super(t, e); this[a] = null; this[u] = ()=>t.iterator(e); this.db.defer(()=>this[f]()); } } class l extends i { constructor(t, e){ super(t, e); this[a] = null; this[u] = ()=>t.keys(e); this.db.defer(()=>this[f]()); } } class h extends o { constructor(t, e){ super(t, e); this[a] = null; this[u] = ()=>t.values(e); this.db.defer(()=>this[f]()); } } for (const d of [ c, l, h ]){ d.prototype[f] = function() { if (this.db.status === 'open') { this[a] = this[u](); } }; d.prototype._next = function(t) { if (this[a] !== null) { this[a].next(t); } else if (this.db.status === 'opening') { this.db.defer(()=>this._next(t)); } else { this.nextTick(t, new s('Iterator is not open: cannot call next() after close()', { code: 'LEVEL_ITERATOR_NOT_OPEN' })); } }; d.prototype._nextv = function(t, e, r) { if (this[a] !== null) { this[a].nextv(t, e, r); } else if (this.db.status === 'opening') { this.db.defer(()=>this._nextv(t, e, r)); } else { this.nextTick(r, new s('Iterator is not open: cannot call nextv() after close()', { code: 'LEVEL_ITERATOR_NOT_OPEN' })); } }; d.prototype._all = function(t, e) { if (this[a] !== null) { this[a].all(e); } else if (this.db.status === 'opening') { this.db.defer(()=>this._all(t, e)); } else { this.nextTick(e, new s('Iterator is not open: cannot call all() after close()', { code: 'LEVEL_ITERATOR_NOT_OPEN' })); } }; d.prototype._seek = function(t, e) { if (this[a] !== null) { this[a]._seek(t, e); } else if (this.db.status === 'opening') { this.db.defer(()=>this._seek(t, e)); } }; d.prototype._close = function(t) { if (this[a] !== null) { this[a].close(t); } else if (this.db.status === 'opening') { this.db.defer(()=>this._close(t)); } else { this.nextTick(t); } }; } e.DeferredIterator = c; e.DeferredKeyIterator = l; e.DeferredValueIterator = h; }), 6909: (function(t, e, r) { "use strict"; const n = r(4375); t.exports = function(t, ...e) { if (e.length === 0) { n(t); } else { n(()=>t(...e)); } }; }), 56: (function(t, e, r) { "use strict"; const n = r(4473); const i = Object.prototype.hasOwnProperty; const o = new Set([ 'lt', 'lte', 'gt', 'gte' ]); t.exports = function(t, e) { const r = {}; for(const s in t){ if (!i.call(t, s)) continue; if (s === 'keyEncoding' || s === 'valueEncoding') continue; if (s === 'start' || s === 'end') { throw new n(`The legacy range option '${s}' has been removed`, { code: 'LEVEL_LEGACY' }); } else if (s === 'encoding') { throw new n("The levelup-style 'encoding' alias has been removed, use 'valueEncoding' instead", { code: 'LEVEL_LEGACY' }); } if (o.has(s)) { r[s] = e.encode(t[s]); } else { r[s] = t[s]; } } r.reverse = !!r.reverse; r.limit = Number.isInteger(r.limit) && r.limit >= 0 ? r.limit : -1; return r; }; }), 1317: (function(t, e, r) { "use strict"; r.r(e); e["default"] = ({}); }), 3883: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(4431); class i { constructor(){ this.BigNum = (t, e)=>{ let r = n.BigNumber.clone({ DECIMAL_PLACES: e }); return new r(t); }; } winstonToAr(t, { formatted: e = false , decimals: r = 12 , trim: n = true } = {}) { let i = this.stringToBigNum(t, r).shiftedBy(-12); return e ? i.toFormat(r) : i.toFixed(r); } arToWinston(t, { formatted: e = false } = {}) { let r = this.stringToBigNum(t).shiftedBy(12); return e ? r.toFormat() : r.toFixed(0); } compare(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.comparedTo(n); } isEqual(t, e) { return this.compare(t, e) === 0; } isLessThan(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.isLessThan(n); } isGreaterThan(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.isGreaterThan(n); } add(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.plus(e).toFixed(0); } sub(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.minus(e).toFixed(0); } stringToBigNum(t, e = 12) { return this.BigNum(t, e); } } e["default"] = i; }), 1286: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); const i = n(r(2990)); r(1317); class o { constructor(t, e){ this.api = t; this.network = e; } async get(t) { const e = await this.api.get(`${o.ENDPOINT}${t}`); if (e.status === 200) { return e.data; } else { if (e.status === 404) { throw new i.default("BLOCK_NOT_FOUND"); } else { throw new Error(`Error while loading block data: ${e}`); } } } async getCurrent() { const { current: t } = await this.network.getInfo(); return await this.get(t); } } e["default"] = o; o.ENDPOINT = "block/hash/"; }), 1070: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; Object.defineProperty(e, "__esModule", ({ value: true })); const s = r(2990); const a = o(r(5160)); class f { constructor(t){ this.api = t; } async getTransactionOffset(t) { const e = await this.api.get(`tx/${t}/offset`); if (e.status === 200) { return e.data; } throw new Error(`Unable to get transaction offset: ${(0, s.getError)(e)}`); } async getChunk(t) { const e = await this.api.get(`chunk/${t}`); if (e.status === 200) { return e.data; } throw new Error(`Unable to get chunk: ${(0, s.getError)(e)}`); } async getChunkData(t) { const e = await this.getChunk(t); const r = a.b64UrlToBuffer(e.chunk); return r; } firstChunkOffset(t) { return parseInt(t.offset) - parseInt(t.size) + 1; } async downloadChunkedData(t) { const e = await this.getTransactionOffset(t); const r = parseInt(e.size); const n = parseInt(e.offset); const i = n - r + 1; const o = new Uint8Array(r); let s = 0; while(s < r){ if (this.api.config.logging) { console.log(`[chunk] ${s}/${r}`); } let a; try { a = await this.getChunkData(i + s); } catch (f) { console.error(`[chunk] Failed to fetch chunk at offset ${i + s}`); console.error(`[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node`); } if (a) { o.set(a, s); s += a.length; } else { throw new Error(`Couldn't complete data download at ${s}/${r}`); } } return o; } } e["default"] = f; }), 9499: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; var s = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); const a = s(r(3883)); const f = s(r(7468)); const u = s(r(602)); const c = s(r(5764)); const l = s(r(5385)); const h = s(r(8379)); const d = s(r(7241)); const p = o(r(5160)); const g = s(r(4486)); const b = s(r(1070)); const v = s(r(1286)); class y { constructor(t){ this.api = new f.default(t); this.wallets = new h.default(this.api, y.crypto); this.chunks = new b.default(this.api); this.transactions = new l.default(this.api, y.crypto, this.chunks); this.silo = new g.default(this.api, this.crypto, this.transactions); this.network = new c.default(this.api); this.blocks = new v.default(this.api, this.network); this.ar = new a.default(); } get crypto() { return y.crypto; } get utils() { return y.utils; } getConfig() { return { api: this.api.getConfig(), crypto: null }; } async createTransaction(t, e) { const r = {}; Object.assign(r, t); if (!t.data && !(t.target && t.quantity)) { throw new Error(`A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.`); } if (t.owner == undefined) { if (e && e !== "use_wallet") { r.owner = e.n; } } if (t.last_tx == undefined) { r.last_tx = await this.transactions.getTransactionAnchor(); } if (typeof t.data === "string") { t.data = p.stringToBuffer(t.data); } if (t.data instanceof ArrayBuffer) { t.data = new Uint8Array(t.data); } if (t.data && !(t.data instanceof Uint8Array)) { throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer"); } if (t.reward == undefined) { const n = t.data ? t.data.byteLength : 0; r.reward = await this.transactions.getPrice(n, r.target); } r.data_root = ""; r.data_size = t.data ? t.data.byteLength.toString() : "0"; r.data = t.data || new Uint8Array(0); const i = new d.default(r); await i.getSignatureData(); return i; } async createSiloTransaction(t, e, r) { const n = {}; Object.assign(n, t); if (!t.data) { throw new Error(`Silo transactions must have a 'data' value`); } if (!r) { throw new Error(`No Silo URI specified.`); } if (t.target || t.quantity) { throw new Error(`Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.`); } if (t.owner == undefined) { if (!e || !e.n) { throw new Error(`A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.`); } n.owner = e.n; } if (t.last_tx == undefined) { n.last_tx = await this.transactions.getTransactionAnchor(); } const i = await this.silo.parseUri(r); if (typeof t.data == "string") { const o = await this.crypto.encrypt(p.stringToBuffer(t.data), i.getEncryptionKey()); n.reward = await this.transactions.getPrice(o.byteLength); n.data = p.bufferTob64Url(o); } if (t.data instanceof Uint8Array) { const s = await this.crypto.encrypt(t.data, i.getEncryptionKey()); n.reward = await this.transactions.getPrice(s.byteLength); n.data = p.bufferTob64Url(s); } const a = new d.default(n); a.addTag("Silo-Name", i.getAccessKey()); a.addTag("Silo-Version", `0.1.0`); return a; } arql(t) { return this.api.post("/arql", t).then((t)=>t.data || []); } } e["default"] = y; y.crypto = new u.default(); y.utils = p; }), 7468: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); const i = n(r(9669)); class o { constructor(t){ this.METHOD_GET = "GET"; this.METHOD_POST = "POST"; this.applyConfig(t); } applyConfig(t) { this.config = this.mergeDefaults(t); } getConfig() { return this.config; } mergeDefaults(t) { const e = t.protocol || "http"; const r = t.port || (e === "https" ? 443 : 80); return { host: t.host || "127.0.0.1", protocol: e, port: r, timeout: t.timeout || 20000, logging: t.logging || false, logger: t.logger || console.log, network: t.network }; } async get(t, e) { try { return await this.request().get(t, e); } catch (r) { if (r.response && r.response.status) { return r.response; } throw r; } } async post(t, e, r) { try { return await this.request().post(t, e, r); } catch (n) { if (n.response && n.response.status) { return n.response; } throw n; } } request() { const t = {}; if (this.config.network) { t["x-network"] = this.config.network; } let e = i.default.create({ baseURL: `${this.config.protocol}://${this.config.host}:${this.config.port}`, timeout: this.config.timeout, maxContentLength: 1024 * 1024 * 512, headers: t }); if (this.config.logging) { e.interceptors.request.use((t)=>{ this.config.logger(`Requesting: ${t.baseURL}/${t.url}`); return t; }); e.interceptors.response.use((t)=>{ this.config.logger(`Response: ${t.config.url} - ${t.status}`); return t; }); } return e; } } e["default"] = o; }), 602: (function(t, e, r) { "use strict"; var n = r(8764)["Buffer"]; var i = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var o = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var s = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) i(e, t, r); o(e, t); return e; }; Object.defineProperty(e, "__esModule", ({ value: true })); const a = r(3068); const f = s(r(2474)); const u = s(r(2454)); class c { constructor(){ this.keyLength = 4096; this.publicExponent = 0x10001; this.hashAlgorithm = "sha256"; this.encryptionAlgorithm = "aes-256-cbc"; } generateJWK() { if (typeof f.generateKeyPair != "function") { throw new Error("Keypair generation not supported in this version of Node, only supported in versions 10+"); } return new Promise((t, e)=>{ f.generateKeyPair("rsa", { modulusLength: this.keyLength, publicExponent: this.publicExponent, privateKeyEncoding: { type: "pkcs1", format: "pem" }, publicKeyEncoding: { type: "pkcs1", format: "pem" } }, (r, n, i)=>{ if (r) { e(r); } t(this.pemToJWK(i)); }); }); } sign(t, e, { saltLength: r } = {}) { return new Promise((n, i)=>{ n(f.createSign(this.hashAlgorithm).update(e).sign({ key: this.jwkToPem(t), padding: u.RSA_PKCS1_PSS_PADDING, saltLength: r })); }); } verify(t, e, r) { return new Promise((n, i)=>{ const o = { kty: "RSA", e: "AQAB", n: t }; const s = this.jwkToPem(o); n(f.createVerify(this.hashAlgorithm).update(e).verify({ key: s, padding: u.RSA_PKCS1_PSS_PADDING }, r)); }); } hash(t, e = "SHA-256") { return new Promise((r, n)=>{ r(f.createHash(this.parseHashAlgorithm(e)).update(t).digest()); }); } async encrypt(t, e, r) { const i = f.pbkdf2Sync(e, (r = r ? r : "salt"), 100000, 32, this.hashAlgorithm); const o = f.randomBytes(16); const s = f.createCipheriv(this.encryptionAlgorithm, i, o); const a = n.concat([ o, s.update(t), s.final() ]); return a; } async decrypt(t, e, r) { try { const i = f.pbkdf2Sync(e, (r = r ? r : "salt"), 100000, 32, this.hashAlgorithm); const o = t.slice(0, 16); const s = t.slice(16); const a = f.createDecipheriv(this.encryptionAlgorithm, i, o); const u = n.concat([ a.update(s), a.final() ]); return u; } catch (c) { throw new Error("Failed to decrypt"); } } jwkToPem(t) { return (0, a.jwkTopem)(t); } pemToJWK(t) { let e = (0, a.pemTojwk)(t); return e; } parseHashAlgorithm(t) { switch(t){ case "SHA-256": return "sha256"; case "SHA-384": return "sha384"; default: throw new Error(`Algorithm not supported: ${t}`); } } } e["default"] = c; }), 3068: (function(t, e, r) { "use strict"; var n = r(8764)["Buffer"]; var i = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var o = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var s = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) i(e, t, r); o(e, t); return e; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.jwkTopem = e.pemTojwk = void 0; const a = s(r(9809)); function f(t) { return t.replace(/\+/g, "-").replace(/\//g, "_").replace(/=/g, ""); } function u(t) { return f(n.from(t, "hex").toString("base64")); } var c = a.define("RSAPublicKey", function() { this.seq().obj(this.key("n").int(), this.key("e").int()); }); var l = a.define("AlgorithmIdentifier", function() { this.seq().obj(this.key("algorithm").objid(), this.key("parameters").optional().any()); }); var h = a.define("PublicKeyInfo", function() { this.seq().obj(this.key("algorithm").use(l), this.key("publicKey").bitstr()); }); var d = a.define("Version", function() { this.int({ 0: "two-prime", 1: "multi" }); }); var p = a.define("OtherPrimeInfos", function() { this.seq().obj(this.key("ri").int(), this.key("di").int(), this.key("ti").int()); }); var g = a.define("RSAPrivateKey", function() { this.seq().obj(this.key("version").use(d), this.key("n").int(), this.key("e").int(), this.key("d").int(), this.key("p").int(), this.key("q").int(), this.key("dp").int(), this.key("dq").int(), this.key("qi").int(), this.key("other").optional().use(p)); }); var b = a.define("PrivateKeyInfo", function() { this.seq().obj(this.key("version").use(d), this.key("algorithm").use(l), this.key("privateKey").bitstr()); }); const v = "1.2.840.113549.1.1.1"; function y(t, e) { e = e || {}; Object.keys(e).forEach(function(r) { t[r] = e[r]; }); return t; } function m(t) { return t.length % 2 === 1 ? "0" + t : t; } function w(t, e) { var r = c.decode(t, "der"); var n = m(r.e.toString(16)); var i = { kty: "RSA", n: T(r.n), e: u(n) }; return y(i, e); } function _(t, e) { var r = g.decode(t, "der"); var n = m(r.e.toString(16)); var i = { kty: "RSA", n: T(r.n), e: u(n), d: T(r.d), p: T(r.p), q: T(r.q), dp: T(r.dp), dq: T(r.dq), qi: T(r.qi) }; return y(i, e); } function S(t, e) { var r = h.decode(t, "der"); return w(r.publicKey.data, e); } function E(t, e) { var r = b.decode(t, "der"); return _(r.privateKey.data, e); } function x(t) { var e = /^-----BEGIN (RSA )?(PUBLIC|PRIVATE) KEY-----$/.exec(t); if (!e) { return null; } var r = !!e[1]; var n = e[2] === "PRIVATE"; if (n) { return r ? _ : E; } else { return r ? w : S; } } function M(t) { return { n: O(t.n), e: O(t.e), d: t.d && O(t.d), p: t.p && O(t.p), q: t.q && O(t.q), dp: t.dp && O(t.dp), dq: t.dq && O(t.dq), qi: t.qi && O(t.qi) }; } function T(t) { return u(m(t.toString(16))); } function A(t) { return new a.bignum(n.from(t, "base64")); } function O(t) { if (/^[0-9]+$/.test(t)) { return new a.bignum(t, 10); } return A(t); } function k(t, e) { var r = t.toString().split(/(\r\n|\r|\n)+/g); r = r.filter(function(t) { return t.trim().length !== 0; }); var i = x(r[0]); r = r.slice(1, -1).join(""); return i(n.from(r.replace(/[^\w\d\+\/=]+/g, ""), "base64"), e); } e.pemTojwk = k; function I(t) { var e = M(t); var r = !!e.d; var i = r ? "PRIVATE" : "PUBLIC"; var o = "-----BEGIN RSA " + i + " KEY-----\n"; var s = "\n-----END RSA " + i + " KEY-----\n"; var a = n.alloc(0); if (r) { e.version = "two-prime"; a = g.encode(e, "der"); } else { a = c.encode(e, "der"); } var f = a.toString("base64").match(/.{1,64}/g).join("\n"); return o + f + s; } e.jwkTopem = I; }), 7439: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); const i = n(r(9499)); async function o(t) { if (Array.isArray(t)) { const e = i.default.utils.concatBuffers([ i.default.utils.stringToBuffer("list"), i.default.utils.stringToBuffer(t.length.toString()) ]); return await s(t, await i.default.crypto.hash(e, "SHA-384")); } const r = i.default.utils.concatBuffers([ i.default.utils.stringToBuffer("blob"), i.default.utils.stringToBuffer(t.byteLength.toString()) ]); const n = i.default.utils.concatBuffers([ await i.default.crypto.hash(r, "SHA-384"), await i.default.crypto.hash(t, "SHA-384") ]); return await i.default.crypto.hash(n, "SHA-384"); } e["default"] = o; async function s(t, e) { if (t.length < 1) { return e; } const r = i.default.utils.concatBuffers([ e, await o(t[0]) ]); const n = await i.default.crypto.hash(r, "SHA-384"); return await s(t.slice(1), n); } }), 2990: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.getError = void 0; class r extends Error { constructor(t, e = {}){ if (e.message) { super(e.message); } else { super(); } this.type = t; this.response = e.response; } getType() { return this.type; } } e["default"] = r; function n(t) { let e = t.data; if (typeof t.data === "string") { try { e = JSON.parse(t.data); } catch (r) {} } if (t.data instanceof ArrayBuffer || t.data instanceof Uint8Array) { try { e = JSON.parse(e.toString()); } catch (n) {} } return e ? e.error || e : t.statusText || "unknown"; } e.getError = n; }), 1612: (function(t, e, r) { "use strict"; var n = r(8764)["Buffer"]; var i = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.debug = e.validatePath = e.arrayCompare = e.bufferToInt = e.intToBuffer = e.arrayFlatten = e.generateProofs = e.buildLayers = e.generateTransactionChunks = e.generateTree = e.computeRootHash = e.generateLeaves = e.chunkData = e.MIN_CHUNK_SIZE = e.MAX_CHUNK_SIZE = void 0; const o = i(r(9499)); const s = r(5160); e.MAX_CHUNK_SIZE = 256 * 1024; e.MIN_CHUNK_SIZE = 32 * 1024; const a = 32; const f = 32; async function u(t) { let r = []; let n = t; let i = 0; while(n.byteLength >= e.MAX_CHUNK_SIZE){ let s = e.MAX_CHUNK_SIZE; let a = n.byteLength - e.MAX_CHUNK_SIZE; if (a > 0 && a < e.MIN_CHUNK_SIZE) { s = Math.ceil(n.byteLength / 2); } const f = n.slice(0, s); const u = await o.default.crypto.hash(f); i += f.byteLength; r.push({ dataHash: u, minByteRange: i - f.byteLength, maxByteRange: i }); n = n.slice(s); } r.push({ dataHash: await o.default.crypto.hash(n), minByteRange: i, maxByteRange: i + n.byteLength }); return r; } e.chunkData = u; async function c(t) { return Promise.all(t.map(async ({ dataHash: t , minByteRange: e , maxByteRange: r })=>{ return { type: "leaf", id: await m(await Promise.all([ m(t), m(w(r)) ])), dataHash: t, minByteRange: e, maxByteRange: r }; })); } e.generateLeaves = c; async function l(t) { const e = await h(t); return e.id; } e.computeRootHash = l; async function h(t) { const e = await p(await c(await u(t))); return e; } e.generateTree = h; async function d(t) { const e = await u(t); const r = await c(e); const n = await p(r); const i = await g(n); const o = e.slice(-1)[0]; if (o.maxByteRange - o.minByteRange === 0) { e.splice(e.length - 1, 1); i.splice(i.length - 1, 1); } return { data_root: n.id, chunks: e, proofs: i }; } e.generateTransactionChunks = d; async function p(t, e = 0) { if (t.length < 2) { const r = t[0]; return r; } const n = []; for(let i = 0; i < t.length; i += 2){ n.push(await y(t[i], t[i + 1])); } return p(n, e + 1); } e.buildLayers = p; function g(t) { const e = b(t); if (!Array.isArray(e)) { return [ e ]; } return v(e); } e.generateProofs = g; function b(t, e = new Uint8Array(), r = 0) { if (t.type == "leaf") { return { offset: t.maxByteRange - 1, proof: (0, s.concatBuffers)([ e, t.dataHash, w(t.maxByteRange) ]) }; } if (t.type == "branch") { const n = (0, s.concatBuffers)([ e, t.leftChild.id, t.rightChild.id, w(t.byteRange) ]); return [ b(t.leftChild, n, r + 1), b(t.rightChild, n, r + 1) ]; } throw new Error(`Unexpected node type`); } function v(t) { const e = []; t.forEach((t)=>{ if (Array.isArray(t)) { e.push(...v(t)); } else { e.push(t); } }); return e; } e.arrayFlatten = v; async function y(t, e) { if (!e) { return t; } let r = { type: "branch", id: await m([ await m(t.id), await m(e.id), await m(w(t.maxByteRange)) ]), byteRange: t.maxByteRange, maxByteRange: e.maxByteRange, leftChild: t, rightChild: e }; return r; } async function m(t) { if (Array.isArray(t)) { t = o.default.utils.concatBuffers(t); } return new Uint8Array(await o.default.crypto.hash(t)); } function w(t) { const e = new Uint8Array(a); for(var r = e.length - 1; r >= 0; r--){ var n = t % 256; e[r] = n; t = (t - n) / 256; } return e; } e.intToBuffer = w; function _(t) { let e = 0; for(var r = 0; r < t.length; r++){ e *= 256; e += t[r]; } return e; } e.bufferToInt = _; const S = (t, e)=>t.every((t, r)=>e[r] === t); e.arrayCompare = S; async function E(t, r, n, i, o) { if (i <= 0) { return false; } if (r >= i) { return E(t, 0, i - 1, i, o); } if (r < 0) { return E(t, 0, 0, i, o); } if (o.length == f + a) { const s = o.slice(0, f); const u = o.slice(s.length, s.length + a); const c = await m([ await m(s), await m(u) ]); let l = (0, e.arrayCompare)(t, c); if (l) { return { offset: i - 1, leftBound: n, rightBound: i, chunkSize: i - n }; } return false; } const h = o.slice(0, f); const d = o.slice(h.length, h.length + f); const p = o.slice(h.length + d.length, h.length + d.length + a); const g = _(p); const b = o.slice(h.length + d.length + p.length); const v = await m([ await m(h), await m(d), await m(p) ]); if ((0, e.arrayCompare)(t, v)) { if (r < g) { return await E(h, r, n, Math.min(i, g), b); } return await E(d, r, Math.max(n, g), i, b); } return false; } e.validatePath = E; async function x(t, e = "") { if (t.byteLength < 1) { return e; } const r = t.slice(0, f); const i = t.slice(r.length, r.length + f); const o = t.slice(r.length + i.length, r.length + i.length + a); const s = _(o); const u = t.slice(r.length + i.length + o.length); const c = await m([ await m(r), await m(i), await m(o) ]); const l = `${e}\n${JSON.stringify(n.from(r))},${JSON.stringify(n.from(i))},${s} => ${JSON.stringify(c)}`; return x(u, l); } e.debug = x; }), 4107: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; var s = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.TransactionUploader = void 0; const a = s(r(7241)); const f = o(r(5160)); const u = r(2990); const c = r(1612); const l = 1; const h = [ "invalid_json", "chunk_too_big", "data_path_too_big", "offset_too_big", "data_size_too_big", "chunk_proof_ratio_not_attractive", "invalid_proof" ]; const d = 1000 * 40; class p { constructor(t, e){ this.api = t; this.chunkIndex = 0; this.txPosted = false; this.lastRequestTimeEnd = 0; this.totalErrors = 0; this.lastResponseStatus = 0; this.lastResponseError = ""; if (!e.id) { throw new Error(`Transaction is not signed`); } if (!e.chunks) { throw new Error(`Transaction chunks not prepared`); } this.data = e.data; this.transaction = new a.default(Object.assign({}, e, { data: new Uint8Array(0) })); } get isComplete() { return (this.txPosted && this.chunkIndex === this.transaction.chunks.chunks.length); } get totalChunks() { return this.transaction.chunks.chunks.length; } get uploadedChunks() { return this.chunkIndex; } get pctComplete() { return Math.trunc((this.uploadedChunks / this.totalChunks) * 100); } async uploadChunk(t) { if (this.isComplete) { throw new Error(`Upload is already complete`); } if (this.lastResponseError !== "") { this.totalErrors++; } else { this.totalErrors = 0; } if (this.totalErrors === 100) { throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`); } let e = this.lastResponseError === "" ? 0 : Math.max(this.lastRequestTimeEnd + d - Date.now(), d); if (e > 0) { e = e - e * Math.random() * 0.3; await new Promise((t)=>setTimeout(t, e)); } this.lastResponseError = ""; if (!this.txPosted) { await this.postTransaction(); return; } if (t) { this.chunkIndex = t; } const r = this.transaction.getChunk(t || this.chunkIndex, this.data); const n = await (0, c.validatePath)(this.transaction.chunks.data_root, parseInt(r.offset), 0, parseInt(r.data_size), f.b64UrlToBuffer(r.data_path)); if (!n) { throw new Error(`Unable to validate chunk ${this.chunkIndex}`); } const i = await this.api.post(`chunk`, this.transaction.getChunk(this.chunkIndex, this.data)).catch((t)=>{ console.error(t.message); return { status: -1, data: { error: t.message } }; }); this.lastRequestTimeEnd = Date.now(); this.lastResponseStatus = i.status; if (this.lastResponseStatus == 200) { this.chunkIndex++; } else { this.lastResponseError = (0, u.getError)(i); if (h.includes(this.lastResponseError)) { throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`); } } } static async fromSerialized(t, e, r) { if (!e || typeof e.chunkIndex !== "number" || typeof e.transaction !== "object") { throw new Error(`Serialized object does not match expected format.`); } var n = new a.default(e.transaction); if (!n.chunks) { await n.prepareChunks(r); } const i = new p(t, n); i.chunkIndex = e.chunkIndex; i.lastRequestTimeEnd = e.lastRequestTimeEnd; i.lastResponseError = e.lastResponseError; i.lastResponseStatus = e.lastResponseStatus; i.txPosted = e.txPosted; i.data = r; if (i.transaction.data_root !== e.transaction.data_root) { throw new Error(`Data mismatch: Uploader doesn't match provided data.`); } return i; } static async fromTransactionId(t, e) { const r = await t.get(`tx/${e}`); if (r.status !== 200) { throw new Error(`Tx ${e} not found: ${r.status}`); } const n = r.data; n.data = new Uint8Array(0); const i = { txPosted: true, chunkIndex: 0, lastResponseError: "", lastRequestTimeEnd: 0, lastResponseStatus: 0, transaction: n }; return i; } toJSON() { return { chunkIndex: this.chunkIndex, transaction: this.transaction, lastRequestTimeEnd: this.lastRequestTimeEnd, lastResponseStatus: this.lastResponseStatus, lastResponseError: this.lastResponseError, txPosted: this.txPosted }; } async postTransaction() { const t = this.totalChunks <= l; if (t) { this.transaction.data = this.data; const e = await this.api.post(`tx`, this.transaction).catch((t)=>{ console.error(t); return { status: -1, data: { error: t.message } }; }); this.lastRequestTimeEnd = Date.now(); this.lastResponseStatus = e.status; this.transaction.data = new Uint8Array(0); if (e.status >= 200 && e.status < 300) { this.txPosted = true; this.chunkIndex = l; return; } this.lastResponseError = (0, u.getError)(e); throw new Error(`Unable to upload transaction: ${e.status}, ${this.lastResponseError}`); } const r = await this.api.post(`tx`, this.transaction); this.lastRequestTimeEnd = Date.now(); this.lastResponseStatus = r.status; if (!(r.status >= 200 && r.status < 300)) { this.lastResponseError = (0, u.getError)(r); throw new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`); } this.txPosted = true; } } e.TransactionUploader = p; }), 7241: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; var s = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.Tag = void 0; const a = o(r(5160)); const f = s(r(7439)); const u = r(1612); class c { get(t, e) { if (!Object.getOwnPropertyNames(this).includes(t)) { throw new Error(`Field "${t}" is not a property of the Arweave Transaction class.`); } if (this[t] instanceof Uint8Array) { if (e && e.decode && e.string) { return a.bufferToString(this[t]); } if (e && e.decode && !e.string) { return this[t]; } return a.bufferTob64Url(this[t]); } if (e && e.decode == true) { if (e && e.string) { return a.b64UrlToString(this[t]); } return a.b64UrlToBuffer(this[t]); } return this[t]; } } class l extends c { constructor(t, e, r = false){ super(); this.name = t; this.value = e; } } e.Tag = l; class h extends c { constructor(t = {}){ super(); this.format = 2; this.id = ""; this.last_tx = ""; this.owner = ""; this.tags = []; this.target = ""; this.quantity = "0"; this.data_size = "0"; this.data = new Uint8Array(); this.data_root = ""; this.reward = "0"; this.signature = ""; Object.assign(this, t); if (typeof this.data === "string") { this.data = a.b64UrlToBuffer(this.data); } if (t.tags) { this.tags = t.tags.map((t)=>{ return new l(t.name, t.value); }); } } addTag(t, e) { this.tags.push(new l(a.stringToB64Url(t), a.stringToB64Url(e))); } toJSON() { return { format: this.format, id: this.id, last_tx: this.last_tx, owner: this.owner, tags: this.tags, target: this.target, quantity: this.quantity, data: a.bufferTob64Url(this.data), data_size: this.data_size, data_root: this.data_root, data_tree: this.data_tree, reward: this.reward, signature: this.signature }; } setOwner(t) { this.owner = t; } setSignature({ id: t , owner: e , reward: r , tags: n , signature: i , }) { this.id = t; this.owner = e; if (r) this.reward = r; if (n) this.tags = n; this.signature = i; } async prepareChunks(t) { if (!this.chunks && t.byteLength > 0) { this.chunks = await (0, u.generateTransactionChunks)(t); this.data_root = a.bufferTob64Url(this.chunks.data_root); } if (!this.chunks && t.byteLength === 0) { this.chunks = { chunks: [], data_root: new Uint8Array(), proofs: [] }; this.data_root = ""; } } getChunk(t, e) { if (!this.chunks) { throw new Error(`Chunks have not been prepared`); } const r = this.chunks.proofs[t]; const n = this.chunks.chunks[t]; return { data_root: this.data_root, data_size: this.data_size, data_path: a.bufferTob64Url(r.proof), offset: r.offset.toString(), chunk: a.bufferTob64Url(e.slice(n.minByteRange, n.maxByteRange)) }; } async getSignatureData() { switch(this.format){ case 1: let t = this.tags.reduce((t, e)=>{ return a.concatBuffers([ t, e.get("name", { decode: true, string: false }), e.get("value", { decode: true, string: false }) ]); }, new Uint8Array()); return a.concatBuffers([ this.get("owner", { decode: true, string: false }), this.get("target", { decode: true, string: false }), this.get("data", { decode: true, string: false }), a.stringToBuffer(this.quantity), a.stringToBuffer(this.reward), this.get("last_tx", { decode: true, string: false }), t ]); case 2: if (!this.data_root) { await this.prepareChunks(this.data); } const e = this.tags.map((t)=>[ t.get("name", { decode: true, string: false }), t.get("value", { decode: true, string: false }) ]); return await (0, f.default)([ a.stringToBuffer(this.format.toString()), this.get("owner", { decode: true, string: false }), this.get("target", { decode: true, string: false }), a.stringToBuffer(this.quantity), a.stringToBuffer(this.reward), this.get("last_tx", { decode: true, string: false }), e, a.stringToBuffer(this.data_size), this.get("data_root", { decode: true, string: false }) ]); default: throw new Error(`Unexpected transaction format: ${this.format}`); } } } e["default"] = h; }), 5160: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.b64UrlDecode = e.b64UrlEncode = e.bufferTob64Url = e.bufferTob64 = e.b64UrlToBuffer = e.stringToB64Url = e.stringToBuffer = e.bufferToString = e.b64UrlToString = e.concatBuffers = void 0; const s = o(r(9742)); function a(t) { let e = 0; for(let r = 0; r < t.length; r++){ e += t[r].byteLength; } let n = new Uint8Array(e); let i = 0; n.set(new Uint8Array(t[0]), i); i += t[0].byteLength; for(let o = 1; o < t.length; o++){ n.set(new Uint8Array(t[o]), i); i += t[o].byteLength; } return n; } e.concatBuffers = a; function f(t) { let e = h(t); if (typeof TextDecoder == "undefined") { const n = (r(9539).TextDecoder); return new n("utf-8", { fatal: true }).decode(e); } return new TextDecoder("utf-8", { fatal: true }).decode(e); } e.b64UrlToString = f; function u(t) { if (typeof TextDecoder == "undefined") { const e = (r(9539).TextDecoder); return new e("utf-8", { fatal: true }).decode(t); } return new TextDecoder("utf-8", { fatal: true }).decode(t); } e.bufferToString = u; function c(t) { if (typeof TextEncoder == "undefined") { const e = (r(9539).TextEncoder); return new e().encode(t); } return new TextEncoder().encode(t); } e.stringToBuffer = c; function l(t) { return p(c(t)); } e.stringToB64Url = l; function h(t) { return new Uint8Array(s.toByteArray(b(t))); } e.b64UrlToBuffer = h; function d(t) { return s.fromByteArray(new Uint8Array(t)); } e.bufferTob64 = d; function p(t) { return g(d(t)); } e.bufferTob64Url = p; function g(t) { return t.replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, ""); } e.b64UrlEncode = g; function b(t) { t = t.replace(/\-/g, "+").replace(/\_/g, "/"); let e; t.length % 4 == 0 ? (e = 0) : (e = 4 - (t.length % 4)); return t.concat("=".repeat(e)); } e.b64UrlDecode = b; }), 5764: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); class r { constructor(t){ this.api = t; } getInfo() { return this.api.get(`info`).then((t)=>{ return t.data; }); } getPeers() { return this.api.get(`peers`).then((t)=>{ return t.data; }); } } e["default"] = r; }), 4486: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.SiloResource = void 0; const s = o(r(5160)); class a { constructor(t, e, r){ this.api = t; this.crypto = e; this.transactions = r; } async get(t) { if (!t) { throw new Error(`No Silo URI specified`); } const e = await this.parseUri(t); const r = await this.transactions.search("Silo-Name", e.getAccessKey()); if (r.length == 0) { throw new Error(`No data could be found for the Silo URI: ${t}`); } const n = await this.transactions.get(r[0]); if (!n) { throw new Error(`No data could be found for the Silo URI: ${t}`); } const i = n.get("data", { decode: true, string: false }); return this.crypto.decrypt(i, e.getEncryptionKey()); } async readTransactionData(t, e) { if (!e) { throw new Error(`No Silo URI specified`); } const r = await this.parseUri(e); const n = t.get("data", { decode: true, string: false }); return this.crypto.decrypt(n, r.getEncryptionKey()); } async parseUri(t) { const e = t.match(/^([a-z0-9-_]+)\.([0-9]+)/i); if (!e) { throw new Error(`Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'`); } const r = e[1]; const n = Math.pow(2, parseInt(e[2])); const i = await this.hash(s.stringToBuffer(r), n); const o = s.bufferTob64(i.slice(0, 15)); const a = await this.hash(i.slice(16, 31), 1); return new f(t, o, a); } async hash(t, e) { let r = await this.crypto.hash(t); for(let n = 0; n < e - 1; n++){ r = await this.crypto.hash(r); } return r; } } e["default"] = a; class f { constructor(t, e, r){ this.uri = t; this.accessKey = e; this.encryptionKey = r; } getUri() { return this.uri; } getAccessKey() { return this.accessKey; } getEncryptionKey() { return this.encryptionKey; } } e.SiloResource = f; }), 5385: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; var s = (this && this.__await) || function(t) { return this instanceof s ? (this.v = t, this) : new s(t); }; var a = (this && this.__asyncGenerator) || function(t, e, r) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var n = r.apply(t, e || []), i, o = []; return i = {}, a("next"), a("throw"), a("return"), i[Symbol.asyncIterator] = function() { return this; }, i; function a(t) { if (n[t]) i[t] = function(e) { return new Promise(function(r, n) { o.push([ t, e, r, n ]) > 1 || f(t, e); }); }; } function f(t, e) { try { u(n[t](e)); } catch (r) { h(o[0][3], r); } } function u(t) { t.value instanceof s ? Promise.resolve(t.value.v).then(c, l) : h(o[0][2], t); } function c(t) { f("next", t); } function l(t) { f("throw", t); } function h(t, e) { if (t(e), o.shift(), o.length) f(o[0][0], o[0][1]); } }; var f = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); const u = f(r(2990)); const c = f(r(7241)); const l = o(r(5160)); const h = r(4107); r(1317); class d { constructor(t, e, r){ this.api = t; this.crypto = e; this.chunks = r; } getTransactionAnchor() { return this.api.get(`tx_anchor`, { transformResponse: [] }).then((t)=>{ return t.data; }); } getPrice(t, e) { let r = e ? `price/${t}/${e}` : `price/${t}`; return this.api.get(r, { transformResponse: [ function(t) { return t; } ] }).then((t)=>{ return t.data; }); } async get(t) { const e = await this.api.get(`tx/${t}`); if (e.status == 200) { const r = parseInt(e.data.data_size); if (e.data.format >= 2 && r > 0 && r <= 1024 * 1024 * 12) { const n = await this.getData(t); return new c.default(Object.assign(Object.assign({}, e.data), { data: n })); } return new c.default(Object.assign(Object.assign({}, e.data), { format: e.data.format || 1 })); } if (e.status == 404) { throw new u.default("TX_NOT_FOUND"); } if (e.status == 410) { throw new u.default("TX_FAILED"); } throw new u.default("TX_INVALID"); } fromRaw(t) { return new c.default(t); } async search(t, e) { return this.api.post(`arql`, { op: "equals", expr1: t, expr2: e }).then((t)=>{ if (!t.data) { return []; } return t.data; }); } getStatus(t) { return this.api.get(`tx/${t}/status`).then((t)=>{ if (t.status == 200) { return { status: 200, confirmed: t.data }; } return { status: t.status, confirmed: null }; }); } async getData(t, e) { let r = undefined; try { r = await this.chunks.downloadChunkedData(t); } catch (n) { console.error(`Error while trying to download chunked data for ${t}`); console.error(n); } if (!r) { console.warn(`Falling back to gateway cache for ${t}`); try { r = (await this.api.get(`/${t}`)).data; } catch (i) { console.error(`Error while trying to download contiguous data from gateway cache for ${t}`); console.error(i); } } if (!r) { throw new Error(`${t} was not found!`); } if (e && e.decode && !e.string) { return r; } if (e && e.decode && e.string) { return l.bufferToString(r); } return l.bufferTob64Url(r); } async sign(t, e, r) { if (!e && (typeof window === "undefined" || !window.arweaveWallet)) { throw new Error(`A new Arweave transaction must provide the jwk parameter.`); } else if (!e || e === "use_wallet") { try { const n = await window.arweaveWallet.getPermissions(); if (!n.includes("SIGN_TRANSACTION")) await window.arweaveWallet.connect([ "SIGN_TRANSACTION" ]); } catch (i) {} const o = await window.arweaveWallet.sign(t, r); t.setSignature({ id: o.id, owner: o.owner, reward: o.reward, tags: o.tags, signature: o.signature }); } else { t.setOwner(e.n); let s = await t.getSignatureData(); let a = await this.crypto.sign(e, s, r); let f = await this.crypto.hash(a); t.setSignature({ id: l.bufferTob64Url(f), owner: e.n, signature: l.bufferTob64Url(a) }); } } async verify(t) { const e = await t.getSignatureData(); const r = t.get("signature", { decode: true, string: false }); const n = l.bufferTob64Url(await this.crypto.hash(r)); if (t.id !== n) { throw new Error(`Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.`); } return this.crypto.verify(t.owner, e, r); } async post(t) { if (typeof t === "string") { t = new c.default(JSON.parse(t)); } else if (typeof t.readInt32BE === "function") { t = new c.default(JSON.parse(t.toString())); } else if (typeof t === "object" && !(t instanceof c.default)) { t = new c.default(t); } if (!(t instanceof c.default)) { throw new Error(`Must be Transaction object`); } if (!t.chunks) { await t.prepareChunks(t.data); } const e = await this.getUploader(t, t.data); try { while(!e.isComplete){ await e.uploadChunk(); } } catch (r) { if (e.lastResponseStatus > 0) { return { status: e.lastResponseStatus, statusText: e.lastResponseError, data: { error: e.lastResponseError } }; } throw r; } return { status: 200, statusText: "OK", data: {} }; } async getUploader(t, e) { let r; if (e instanceof ArrayBuffer) { e = new Uint8Array(e); } if (t instanceof c.default) { if (!e) { e = t.data; } if (!(e instanceof Uint8Array)) { throw new Error("Data format is invalid"); } if (!t.chunks) { await t.prepareChunks(e); } r = new h.TransactionUploader(this.api, t); if (!r.data || r.data.length === 0) { r.data = e; } } else { if (typeof t === "string") { t = await h.TransactionUploader.fromTransactionId(this.api, t); } if (!e || !(e instanceof Uint8Array)) { throw new Error(`Must provide data when resuming upload`); } r = await h.TransactionUploader.fromSerialized(this.api, t, e); } return r; } upload(t, e) { return a(this, arguments, function* r() { const n = yield s(this.getUploader(t, e)); while(!n.isComplete){ yield s(n.uploadChunk()); yield yield s(n); } return yield s(n); }); } } e["default"] = d; }), 8379: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; Object.defineProperty(e, "__esModule", ({ value: true })); const s = o(r(5160)); r(1317); class a { constructor(t, e){ this.api = t; this.crypto = e; } getBalance(t) { return this.api.get(`wallet/${t}/balance`, { transformResponse: [ function(t) { return t; } ] }).then((t)=>{ return t.data; }); } getLastTransactionID(t) { return this.api.get(`wallet/${t}/last_tx`).then((t)=>{ return t.data; }); } generate() { return this.crypto.generateJWK(); } async jwkToAddress(t) { if (!t || t === "use_wallet") { return this.getAddress(); } else { return this.getAddress(t); } } async getAddress(t) { if (!t || t === "use_wallet") { try { await window.arweaveWallet.connect([ "ACCESS_ADDRESS" ]); } catch (e) {} return window.arweaveWallet.getActiveAddress(); } else { return this.ownerToAddress(t.n); } } async ownerToAddress(t) { return s.bufferTob64Url(await this.crypto.hash(s.b64UrlToBuffer(t))); } } e["default"] = a; }), 4586: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(4431); class i { constructor(){ this.BigNum = (t, e)=>{ let r = n.BigNumber.clone({ DECIMAL_PLACES: e }); return new r(t); }; } winstonToAr(t, { formatted: e = false , decimals: r = 12 , trim: n = true } = {}) { let i = this.stringToBigNum(t, r).shiftedBy(-12); return e ? i.toFormat(r) : i.toFixed(r); } arToWinston(t, { formatted: e = false } = {}) { let r = this.stringToBigNum(t).shiftedBy(12); return e ? r.toFormat() : r.toFixed(0); } compare(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.comparedTo(n); } isEqual(t, e) { return this.compare(t, e) === 0; } isLessThan(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.isLessThan(n); } isGreaterThan(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.isGreaterThan(n); } add(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.plus(e).toFixed(0); } sub(t, e) { let r = this.stringToBigNum(t); let n = this.stringToBigNum(e); return r.minus(e).toFixed(0); } stringToBigNum(t, e = 12) { return this.BigNum(t, e); } } e["default"] = i; }), 3759: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(5498); r(1317); class i { constructor(t, e){ this.api = t; this.network = e; } async get(t) { const e = await this.api.get(`${i.ENDPOINT}${t}`); if (e.status === 200) { return e.data; } else { if (e.status === 404) { throw new n.default("BLOCK_NOT_FOUND"); } else { throw new Error(`Error while loading block data: ${e}`); } } } async getCurrent() { const { current: t } = await this.network.getInfo(); return await this.get(t); } } e["default"] = i; i.ENDPOINT = "block/hash/"; }), 6879: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(5498); const i = r(8244); class o { constructor(t){ this.api = t; } async getTransactionOffset(t) { const e = await this.api.get(`tx/${t}/offset`); if (e.status === 200) { return e.data; } throw new Error(`Unable to get transaction offset: ${(0, n.getError)(e)}`); } async getChunk(t) { const e = await this.api.get(`chunk/${t}`); if (e.status === 200) { return e.data; } throw new Error(`Unable to get chunk: ${(0, n.getError)(e)}`); } async getChunkData(t) { const e = await this.getChunk(t); const r = i.b64UrlToBuffer(e.chunk); return r; } firstChunkOffset(t) { return parseInt(t.offset) - parseInt(t.size) + 1; } async downloadChunkedData(t) { const e = await this.getTransactionOffset(t); const r = parseInt(e.size); const n = parseInt(e.offset); const i = n - r + 1; const o = new Uint8Array(r); let s = 0; while(s < r){ if (this.api.config.logging) { console.log(`[chunk] ${s}/${r}`); } let a; try { a = await this.getChunkData(i + s); } catch (f) { console.error(`[chunk] Failed to fetch chunk at offset ${i + s}`); console.error(`[chunk] This could indicate that the chunk wasn't uploaded or hasn't yet seeded properly to a particular gateway/node`); } if (a) { o.set(a, s); s += a.length; } else { throw new Error(`Couldn't complete data download at ${s}/${r}`); } } return o; } } e["default"] = o; }), 536: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(4586); const i = r(6874); const o = r(9363); const s = r(2248); const a = r(6935); const f = r(7927); const u = r(7825); const c = r(8244); const l = r(1243); const h = r(6879); const d = r(3759); class p { constructor(t){ this.api = new i.default(t); this.wallets = new f.default(this.api, p.crypto); this.chunks = new h.default(this.api); this.transactions = new a.default(this.api, p.crypto, this.chunks); this.silo = new l.default(this.api, this.crypto, this.transactions); this.network = new s.default(this.api); this.blocks = new d.default(this.api, this.network); this.ar = new n.default(); } get crypto() { return p.crypto; } get utils() { return p.utils; } getConfig() { return { api: this.api.getConfig(), crypto: null }; } async createTransaction(t, e) { const r = {}; Object.assign(r, t); if (!t.data && !(t.target && t.quantity)) { throw new Error(`A new Arweave transaction must have a 'data' value, or 'target' and 'quantity' values.`); } if (t.owner == undefined) { if (e && e !== "use_wallet") { r.owner = e.n; } } if (t.last_tx == undefined) { r.last_tx = await this.transactions.getTransactionAnchor(); } if (typeof t.data === "string") { t.data = c.stringToBuffer(t.data); } if (t.data instanceof ArrayBuffer) { t.data = new Uint8Array(t.data); } if (t.data && !(t.data instanceof Uint8Array)) { throw new Error("Expected data to be a string, Uint8Array or ArrayBuffer"); } if (t.reward == undefined) { const n = t.data ? t.data.byteLength : 0; r.reward = await this.transactions.getPrice(n, r.target); } r.data_root = ""; r.data_size = t.data ? t.data.byteLength.toString() : "0"; r.data = t.data || new Uint8Array(0); const i = new u.default(r); await i.getSignatureData(); return i; } async createSiloTransaction(t, e, r) { const n = {}; Object.assign(n, t); if (!t.data) { throw new Error(`Silo transactions must have a 'data' value`); } if (!r) { throw new Error(`No Silo URI specified.`); } if (t.target || t.quantity) { throw new Error(`Silo transactions can only be used for storing data, sending AR to other wallets isn't supported.`); } if (t.owner == undefined) { if (!e || !e.n) { throw new Error(`A new Arweave transaction must either have an 'owner' attribute, or you must provide the jwk parameter.`); } n.owner = e.n; } if (t.last_tx == undefined) { n.last_tx = await this.transactions.getTransactionAnchor(); } const i = await this.silo.parseUri(r); if (typeof t.data == "string") { const o = await this.crypto.encrypt(c.stringToBuffer(t.data), i.getEncryptionKey()); n.reward = await this.transactions.getPrice(o.byteLength); n.data = c.bufferTob64Url(o); } if (t.data instanceof Uint8Array) { const s = await this.crypto.encrypt(t.data, i.getEncryptionKey()); n.reward = await this.transactions.getPrice(s.byteLength); n.data = c.bufferTob64Url(s); } const a = new u.default(n); a.addTag("Silo-Name", i.getAccessKey()); a.addTag("Silo-Version", `0.1.0`); return a; } arql(t) { return this.api.post("/arql", t).then((t)=>t.data || []); } } e["default"] = p; p.crypto = new o.default(); p.utils = c; }), 7386: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__exportStar) || function(t, e) { for(var r in t)if (r !== "default" && !Object.prototype.hasOwnProperty.call(e, r)) n(e, t, r); }; Object.defineProperty(e, "__esModule", ({ value: true })); const o = r(536); o.default.init = function(t = {}) { function e() { const t = { host: "arweave.net", port: 443, protocol: "https" }; if (!window || !window.location || !window.location.protocol || !window.location.hostname) { return t; } const e = window.location.protocol.replace(":", ""); const r = window.location.hostname; const n = window.location.port ? parseInt(window.location.port) : e == "https" ? 443 : 80; const i = [ "localhost", "127.0.0.1" ].includes(r) || e == "file"; if (i) { return t; } return { host: r, port: n, protocol: e }; } const r = e(); const n = t.protocol || r.protocol; const i = t.host || r.host; const s = t.port || r.port; return new o.default(Object.assign(Object.assign({}, t), { host: i, protocol: n, port: s })); }; window.Arweave = o.default; i(r(536), e); e["default"] = o.default; }), 6874: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(9669); class i { constructor(t){ this.METHOD_GET = "GET"; this.METHOD_POST = "POST"; this.applyConfig(t); } applyConfig(t) { this.config = this.mergeDefaults(t); } getConfig() { return this.config; } mergeDefaults(t) { const e = t.protocol || "http"; const r = t.port || (e === "https" ? 443 : 80); return { host: t.host || "127.0.0.1", protocol: e, port: r, timeout: t.timeout || 20000, logging: t.logging || false, logger: t.logger || console.log, network: t.network }; } async get(t, e) { try { return await this.request().get(t, e); } catch (r) { if (r.response && r.response.status) { return r.response; } throw r; } } async post(t, e, r) { try { return await this.request().post(t, e, r); } catch (n) { if (n.response && n.response.status) { return n.response; } throw n; } } request() { const t = {}; if (this.config.network) { t["x-network"] = this.config.network; } let e = n.default.create({ baseURL: `${this.config.protocol}://${this.config.host}:${this.config.port}`, timeout: this.config.timeout, maxContentLength: 1024 * 1024 * 512, headers: t }); if (this.config.logging) { e.interceptors.request.use((t)=>{ this.config.logger(`Requesting: ${t.baseURL}/${t.url}`); return t; }); e.interceptors.response.use((t)=>{ this.config.logger(`Response: ${t.config.url} - ${t.status}`); return t; }); } return e; } } e["default"] = i; }), 9363: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(8244); class i { constructor(){ this.keyLength = 4096; this.publicExponent = 0x10001; this.hashAlgorithm = "sha256"; if (!this.detectWebCrypto()) { throw new Error("SubtleCrypto not available!"); } this.driver = crypto.subtle; } async generateJWK() { let t = await this.driver.generateKey({ name: "RSA-PSS", modulusLength: 4096, publicExponent: new Uint8Array([ 0x01, 0x00, 0x01 ]), hash: { name: "SHA-256" } }, true, [ "sign" ]); let e = await this.driver.exportKey("jwk", t.privateKey); return { kty: e.kty, e: e.e, n: e.n, d: e.d, p: e.p, q: e.q, dp: e.dp, dq: e.dq, qi: e.qi }; } async sign(t, e, { saltLength: r } = {}) { let n = await this.driver.sign({ name: "RSA-PSS", saltLength: 32 }, await this.jwkToCryptoKey(t), e); return new Uint8Array(n); } async hash(t, e = "SHA-256") { let r = await this.driver.digest(e, t); return new Uint8Array(r); } async verify(t, e, r) { const n = { kty: "RSA", e: "AQAB", n: t }; const i = await this.jwkToPublicCryptoKey(n); const o = this.driver.verify({ name: "RSA-PSS", saltLength: 32 }, i, r, e); const s = this.driver.verify({ name: "RSA-PSS", saltLength: 0 }, i, r, e); return o || s; } async jwkToCryptoKey(t) { return this.driver.importKey("jwk", t, { name: "RSA-PSS", hash: { name: "SHA-256" } }, false, [ "sign" ]); } async jwkToPublicCryptoKey(t) { return this.driver.importKey("jwk", t, { name: "RSA-PSS", hash: { name: "SHA-256" } }, false, [ "verify" ]); } detectWebCrypto() { if (typeof crypto === "undefined") { return false; } const t = crypto === null || crypto === void 0 ? void 0 : crypto.subtle; if (t === undefined) { return false; } const e = [ "generateKey", "importKey", "exportKey", "digest", "sign" ]; return e.every((e)=>typeof t[e] === "function"); } async encrypt(t, e, r) { const i = await this.driver.importKey("raw", typeof e == "string" ? n.stringToBuffer(e) : e, { name: "PBKDF2", length: 32 }, false, [ "deriveKey" ]); const o = await this.driver.deriveKey({ name: "PBKDF2", salt: r ? n.stringToBuffer(r) : n.stringToBuffer("salt"), iterations: 100000, hash: "SHA-256" }, i, { name: "AES-CBC", length: 256 }, false, [ "encrypt", "decrypt" ]); const s = new Uint8Array(16); crypto.getRandomValues(s); const a = await this.driver.encrypt({ name: "AES-CBC", iv: s }, o, t); return n.concatBuffers([ s, a ]); } async decrypt(t, e, r) { const i = await this.driver.importKey("raw", typeof e == "string" ? n.stringToBuffer(e) : e, { name: "PBKDF2", length: 32 }, false, [ "deriveKey" ]); const o = await this.driver.deriveKey({ name: "PBKDF2", salt: r ? n.stringToBuffer(r) : n.stringToBuffer("salt"), iterations: 100000, hash: "SHA-256" }, i, { name: "AES-CBC", length: 256 }, false, [ "encrypt", "decrypt" ]); const s = t.slice(0, 16); const a = await this.driver.decrypt({ name: "AES-CBC", iv: s }, o, t.slice(16)); return n.concatBuffers([ a ]); } } e["default"] = i; }), 921: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(536); async function i(t) { if (Array.isArray(t)) { const e = n.default.utils.concatBuffers([ n.default.utils.stringToBuffer("list"), n.default.utils.stringToBuffer(t.length.toString()) ]); return await o(t, await n.default.crypto.hash(e, "SHA-384")); } const r = n.default.utils.concatBuffers([ n.default.utils.stringToBuffer("blob"), n.default.utils.stringToBuffer(t.byteLength.toString()) ]); const i = n.default.utils.concatBuffers([ await n.default.crypto.hash(r, "SHA-384"), await n.default.crypto.hash(t, "SHA-384") ]); return await n.default.crypto.hash(i, "SHA-384"); } e["default"] = i; async function o(t, e) { if (t.length < 1) { return e; } const r = n.default.utils.concatBuffers([ e, await i(t[0]) ]); const s = await n.default.crypto.hash(r, "SHA-384"); return await o(t.slice(1), s); } }), 5498: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.getError = void 0; class r extends Error { constructor(t, e = {}){ if (e.message) { super(e.message); } else { super(); } this.type = t; this.response = e.response; } getType() { return this.type; } } e["default"] = r; function n(t) { let e = t.data; if (typeof t.data === "string") { try { e = JSON.parse(t.data); } catch (r) {} } if (t.data instanceof ArrayBuffer || t.data instanceof Uint8Array) { try { e = JSON.parse(e.toString()); } catch (n) {} } return e ? e.error || e : t.statusText || "unknown"; } e.getError = n; }), 8224: (function(t, e, r) { "use strict"; var n = r(8764)["Buffer"]; Object.defineProperty(e, "__esModule", ({ value: true })); e.debug = e.validatePath = e.arrayCompare = e.bufferToInt = e.intToBuffer = e.arrayFlatten = e.generateProofs = e.buildLayers = e.generateTransactionChunks = e.generateTree = e.computeRootHash = e.generateLeaves = e.chunkData = e.MIN_CHUNK_SIZE = e.MAX_CHUNK_SIZE = void 0; const i = r(536); const o = r(8244); e.MAX_CHUNK_SIZE = 256 * 1024; e.MIN_CHUNK_SIZE = 32 * 1024; const s = 32; const a = 32; async function f(t) { let r = []; let n = t; let o = 0; while(n.byteLength >= e.MAX_CHUNK_SIZE){ let s = e.MAX_CHUNK_SIZE; let a = n.byteLength - e.MAX_CHUNK_SIZE; if (a > 0 && a < e.MIN_CHUNK_SIZE) { s = Math.ceil(n.byteLength / 2); } const f = n.slice(0, s); const u = await i.default.crypto.hash(f); o += f.byteLength; r.push({ dataHash: u, minByteRange: o - f.byteLength, maxByteRange: o }); n = n.slice(s); } r.push({ dataHash: await i.default.crypto.hash(n), minByteRange: o, maxByteRange: o + n.byteLength }); return r; } e.chunkData = f; async function u(t) { return Promise.all(t.map(async ({ dataHash: t , minByteRange: e , maxByteRange: r })=>{ return { type: "leaf", id: await y(await Promise.all([ y(t), y(m(r)) ])), dataHash: t, minByteRange: e, maxByteRange: r }; })); } e.generateLeaves = u; async function c(t) { const e = await l(t); return e.id; } e.computeRootHash = c; async function l(t) { const e = await d(await u(await f(t))); return e; } e.generateTree = l; async function h(t) { const e = await f(t); const r = await u(e); const n = await d(r); const i = await p(n); const o = e.slice(-1)[0]; if (o.maxByteRange - o.minByteRange === 0) { e.splice(e.length - 1, 1); i.splice(i.length - 1, 1); } return { data_root: n.id, chunks: e, proofs: i }; } e.generateTransactionChunks = h; async function d(t, e = 0) { if (t.length < 2) { const r = t[0]; return r; } const n = []; for(let i = 0; i < t.length; i += 2){ n.push(await v(t[i], t[i + 1])); } return d(n, e + 1); } e.buildLayers = d; function p(t) { const e = g(t); if (!Array.isArray(e)) { return [ e ]; } return b(e); } e.generateProofs = p; function g(t, e = new Uint8Array(), r = 0) { if (t.type == "leaf") { return { offset: t.maxByteRange - 1, proof: (0, o.concatBuffers)([ e, t.dataHash, m(t.maxByteRange) ]) }; } if (t.type == "branch") { const n = (0, o.concatBuffers)([ e, t.leftChild.id, t.rightChild.id, m(t.byteRange) ]); return [ g(t.leftChild, n, r + 1), g(t.rightChild, n, r + 1) ]; } throw new Error(`Unexpected node type`); } function b(t) { const e = []; t.forEach((t)=>{ if (Array.isArray(t)) { e.push(...b(t)); } else { e.push(t); } }); return e; } e.arrayFlatten = b; async function v(t, e) { if (!e) { return t; } let r = { type: "branch", id: await y([ await y(t.id), await y(e.id), await y(m(t.maxByteRange)) ]), byteRange: t.maxByteRange, maxByteRange: e.maxByteRange, leftChild: t, rightChild: e }; return r; } async function y(t) { if (Array.isArray(t)) { t = i.default.utils.concatBuffers(t); } return new Uint8Array(await i.default.crypto.hash(t)); } function m(t) { const e = new Uint8Array(s); for(var r = e.length - 1; r >= 0; r--){ var n = t % 256; e[r] = n; t = (t - n) / 256; } return e; } e.intToBuffer = m; function w(t) { let e = 0; for(var r = 0; r < t.length; r++){ e *= 256; e += t[r]; } return e; } e.bufferToInt = w; const _ = (t, e)=>t.every((t, r)=>e[r] === t); e.arrayCompare = _; async function S(t, r, n, i, o) { if (i <= 0) { return false; } if (r >= i) { return S(t, 0, i - 1, i, o); } if (r < 0) { return S(t, 0, 0, i, o); } if (o.length == a + s) { const f = o.slice(0, a); const u = o.slice(f.length, f.length + s); const c = await y([ await y(f), await y(u) ]); let l = (0, e.arrayCompare)(t, c); if (l) { return { offset: i - 1, leftBound: n, rightBound: i, chunkSize: i - n }; } return false; } const h = o.slice(0, a); const d = o.slice(h.length, h.length + a); const p = o.slice(h.length + d.length, h.length + d.length + s); const g = w(p); const b = o.slice(h.length + d.length + p.length); const v = await y([ await y(h), await y(d), await y(p) ]); if ((0, e.arrayCompare)(t, v)) { if (r < g) { return await S(h, r, n, Math.min(i, g), b); } return await S(d, r, Math.max(n, g), i, b); } return false; } e.validatePath = S; async function E(t, e = "") { if (t.byteLength < 1) { return e; } const r = t.slice(0, a); const i = t.slice(r.length, r.length + a); const o = t.slice(r.length + i.length, r.length + i.length + s); const f = w(o); const u = t.slice(r.length + i.length + o.length); const c = await y([ await y(r), await y(i), await y(o) ]); const l = `${e}\n${JSON.stringify(n.from(r))},${JSON.stringify(n.from(i))},${f} => ${JSON.stringify(c)}`; return E(u, l); } e.debug = E; }), 1246: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.TransactionUploader = void 0; const n = r(7825); const i = r(8244); const o = r(5498); const s = r(8224); const a = 1; const f = [ "invalid_json", "chunk_too_big", "data_path_too_big", "offset_too_big", "data_size_too_big", "chunk_proof_ratio_not_attractive", "invalid_proof" ]; const u = 1000 * 40; class c { constructor(t, e){ this.api = t; this.chunkIndex = 0; this.txPosted = false; this.lastRequestTimeEnd = 0; this.totalErrors = 0; this.lastResponseStatus = 0; this.lastResponseError = ""; if (!e.id) { throw new Error(`Transaction is not signed`); } if (!e.chunks) { throw new Error(`Transaction chunks not prepared`); } this.data = e.data; this.transaction = new n.default(Object.assign({}, e, { data: new Uint8Array(0) })); } get isComplete() { return (this.txPosted && this.chunkIndex === this.transaction.chunks.chunks.length); } get totalChunks() { return this.transaction.chunks.chunks.length; } get uploadedChunks() { return this.chunkIndex; } get pctComplete() { return Math.trunc((this.uploadedChunks / this.totalChunks) * 100); } async uploadChunk(t) { if (this.isComplete) { throw new Error(`Upload is already complete`); } if (this.lastResponseError !== "") { this.totalErrors++; } else { this.totalErrors = 0; } if (this.totalErrors === 100) { throw new Error(`Unable to complete upload: ${this.lastResponseStatus}: ${this.lastResponseError}`); } let e = this.lastResponseError === "" ? 0 : Math.max(this.lastRequestTimeEnd + u - Date.now(), u); if (e > 0) { e = e - e * Math.random() * 0.3; await new Promise((t)=>setTimeout(t, e)); } this.lastResponseError = ""; if (!this.txPosted) { await this.postTransaction(); return; } if (t) { this.chunkIndex = t; } const r = this.transaction.getChunk(t || this.chunkIndex, this.data); const n = await (0, s.validatePath)(this.transaction.chunks.data_root, parseInt(r.offset), 0, parseInt(r.data_size), i.b64UrlToBuffer(r.data_path)); if (!n) { throw new Error(`Unable to validate chunk ${this.chunkIndex}`); } const a = await this.api.post(`chunk`, this.transaction.getChunk(this.chunkIndex, this.data)).catch((t)=>{ console.error(t.message); return { status: -1, data: { error: t.message } }; }); this.lastRequestTimeEnd = Date.now(); this.lastResponseStatus = a.status; if (this.lastResponseStatus == 200) { this.chunkIndex++; } else { this.lastResponseError = (0, o.getError)(a); if (f.includes(this.lastResponseError)) { throw new Error(`Fatal error uploading chunk ${this.chunkIndex}: ${this.lastResponseError}`); } } } static async fromSerialized(t, e, r) { if (!e || typeof e.chunkIndex !== "number" || typeof e.transaction !== "object") { throw new Error(`Serialized object does not match expected format.`); } var i = new n.default(e.transaction); if (!i.chunks) { await i.prepareChunks(r); } const o = new c(t, i); o.chunkIndex = e.chunkIndex; o.lastRequestTimeEnd = e.lastRequestTimeEnd; o.lastResponseError = e.lastResponseError; o.lastResponseStatus = e.lastResponseStatus; o.txPosted = e.txPosted; o.data = r; if (o.transaction.data_root !== e.transaction.data_root) { throw new Error(`Data mismatch: Uploader doesn't match provided data.`); } return o; } static async fromTransactionId(t, e) { const r = await t.get(`tx/${e}`); if (r.status !== 200) { throw new Error(`Tx ${e} not found: ${r.status}`); } const n = r.data; n.data = new Uint8Array(0); const i = { txPosted: true, chunkIndex: 0, lastResponseError: "", lastRequestTimeEnd: 0, lastResponseStatus: 0, transaction: n }; return i; } toJSON() { return { chunkIndex: this.chunkIndex, transaction: this.transaction, lastRequestTimeEnd: this.lastRequestTimeEnd, lastResponseStatus: this.lastResponseStatus, lastResponseError: this.lastResponseError, txPosted: this.txPosted }; } async postTransaction() { const t = this.totalChunks <= a; if (t) { this.transaction.data = this.data; const e = await this.api.post(`tx`, this.transaction).catch((t)=>{ console.error(t); return { status: -1, data: { error: t.message } }; }); this.lastRequestTimeEnd = Date.now(); this.lastResponseStatus = e.status; this.transaction.data = new Uint8Array(0); if (e.status >= 200 && e.status < 300) { this.txPosted = true; this.chunkIndex = a; return; } this.lastResponseError = (0, o.getError)(e); throw new Error(`Unable to upload transaction: ${e.status}, ${this.lastResponseError}`); } const r = await this.api.post(`tx`, this.transaction); this.lastRequestTimeEnd = Date.now(); this.lastResponseStatus = r.status; if (!(r.status >= 200 && r.status < 300)) { this.lastResponseError = (0, o.getError)(r); throw new Error(`Unable to upload transaction: ${r.status}, ${this.lastResponseError}`); } this.txPosted = true; } } e.TransactionUploader = c; }), 7825: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.Tag = void 0; const n = r(8244); const i = r(921); const o = r(8224); class s { get(t, e) { if (!Object.getOwnPropertyNames(this).includes(t)) { throw new Error(`Field "${t}" is not a property of the Arweave Transaction class.`); } if (this[t] instanceof Uint8Array) { if (e && e.decode && e.string) { return n.bufferToString(this[t]); } if (e && e.decode && !e.string) { return this[t]; } return n.bufferTob64Url(this[t]); } if (e && e.decode == true) { if (e && e.string) { return n.b64UrlToString(this[t]); } return n.b64UrlToBuffer(this[t]); } return this[t]; } } class a extends s { constructor(t, e, r = false){ super(); this.name = t; this.value = e; } } e.Tag = a; class f extends s { constructor(t = {}){ super(); this.format = 2; this.id = ""; this.last_tx = ""; this.owner = ""; this.tags = []; this.target = ""; this.quantity = "0"; this.data_size = "0"; this.data = new Uint8Array(); this.data_root = ""; this.reward = "0"; this.signature = ""; Object.assign(this, t); if (typeof this.data === "string") { this.data = n.b64UrlToBuffer(this.data); } if (t.tags) { this.tags = t.tags.map((t)=>{ return new a(t.name, t.value); }); } } addTag(t, e) { this.tags.push(new a(n.stringToB64Url(t), n.stringToB64Url(e))); } toJSON() { return { format: this.format, id: this.id, last_tx: this.last_tx, owner: this.owner, tags: this.tags, target: this.target, quantity: this.quantity, data: n.bufferTob64Url(this.data), data_size: this.data_size, data_root: this.data_root, data_tree: this.data_tree, reward: this.reward, signature: this.signature }; } setOwner(t) { this.owner = t; } setSignature({ id: t , owner: e , reward: r , tags: n , signature: i , }) { this.id = t; this.owner = e; if (r) this.reward = r; if (n) this.tags = n; this.signature = i; } async prepareChunks(t) { if (!this.chunks && t.byteLength > 0) { this.chunks = await (0, o.generateTransactionChunks)(t); this.data_root = n.bufferTob64Url(this.chunks.data_root); } if (!this.chunks && t.byteLength === 0) { this.chunks = { chunks: [], data_root: new Uint8Array(), proofs: [] }; this.data_root = ""; } } getChunk(t, e) { if (!this.chunks) { throw new Error(`Chunks have not been prepared`); } const r = this.chunks.proofs[t]; const i = this.chunks.chunks[t]; return { data_root: this.data_root, data_size: this.data_size, data_path: n.bufferTob64Url(r.proof), offset: r.offset.toString(), chunk: n.bufferTob64Url(e.slice(i.minByteRange, i.maxByteRange)) }; } async getSignatureData() { switch(this.format){ case 1: let t = this.tags.reduce((t, e)=>{ return n.concatBuffers([ t, e.get("name", { decode: true, string: false }), e.get("value", { decode: true, string: false }) ]); }, new Uint8Array()); return n.concatBuffers([ this.get("owner", { decode: true, string: false }), this.get("target", { decode: true, string: false }), this.get("data", { decode: true, string: false }), n.stringToBuffer(this.quantity), n.stringToBuffer(this.reward), this.get("last_tx", { decode: true, string: false }), t ]); case 2: if (!this.data_root) { await this.prepareChunks(this.data); } const e = this.tags.map((t)=>[ t.get("name", { decode: true, string: false }), t.get("value", { decode: true, string: false }) ]); return await (0, i.default)([ n.stringToBuffer(this.format.toString()), this.get("owner", { decode: true, string: false }), this.get("target", { decode: true, string: false }), n.stringToBuffer(this.quantity), n.stringToBuffer(this.reward), this.get("last_tx", { decode: true, string: false }), e, n.stringToBuffer(this.data_size), this.get("data_root", { decode: true, string: false }) ]); default: throw new Error(`Unexpected transaction format: ${this.format}`); } } } e["default"] = f; }), 8244: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.b64UrlDecode = e.b64UrlEncode = e.bufferTob64Url = e.bufferTob64 = e.b64UrlToBuffer = e.stringToB64Url = e.stringToBuffer = e.bufferToString = e.b64UrlToString = e.concatBuffers = void 0; const n = r(9742); function i(t) { let e = 0; for(let r = 0; r < t.length; r++){ e += t[r].byteLength; } let n = new Uint8Array(e); let i = 0; n.set(new Uint8Array(t[0]), i); i += t[0].byteLength; for(let o = 1; o < t.length; o++){ n.set(new Uint8Array(t[o]), i); i += t[o].byteLength; } return n; } e.concatBuffers = i; function o(t) { let e = u(t); if (typeof TextDecoder == "undefined") { const n = (r(9539).TextDecoder); return new n("utf-8", { fatal: true }).decode(e); } return new TextDecoder("utf-8", { fatal: true }).decode(e); } e.b64UrlToString = o; function s(t) { if (typeof TextDecoder == "undefined") { const e = (r(9539).TextDecoder); return new e("utf-8", { fatal: true }).decode(t); } return new TextDecoder("utf-8", { fatal: true }).decode(t); } e.bufferToString = s; function a(t) { if (typeof TextEncoder == "undefined") { const e = (r(9539).TextEncoder); return new e().encode(t); } return new TextEncoder().encode(t); } e.stringToBuffer = a; function f(t) { return l(a(t)); } e.stringToB64Url = f; function u(t) { return new Uint8Array(n.toByteArray(d(t))); } e.b64UrlToBuffer = u; function c(t) { return n.fromByteArray(new Uint8Array(t)); } e.bufferTob64 = c; function l(t) { return h(c(t)); } e.bufferTob64Url = l; function h(t) { return t.replace(/\+/g, "-").replace(/\//g, "_").replace(/\=/g, ""); } e.b64UrlEncode = h; function d(t) { t = t.replace(/\-/g, "+").replace(/\_/g, "/"); let e; t.length % 4 == 0 ? (e = 0) : (e = 4 - (t.length % 4)); return t.concat("=".repeat(e)); } e.b64UrlDecode = d; }), 2248: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); class r { constructor(t){ this.api = t; } getInfo() { return this.api.get(`info`).then((t)=>{ return t.data; }); } getPeers() { return this.api.get(`peers`).then((t)=>{ return t.data; }); } } e["default"] = r; }), 1243: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.SiloResource = void 0; const n = r(8244); class i { constructor(t, e, r){ this.api = t; this.crypto = e; this.transactions = r; } async get(t) { if (!t) { throw new Error(`No Silo URI specified`); } const e = await this.parseUri(t); const r = await this.transactions.search("Silo-Name", e.getAccessKey()); if (r.length == 0) { throw new Error(`No data could be found for the Silo URI: ${t}`); } const n = await this.transactions.get(r[0]); if (!n) { throw new Error(`No data could be found for the Silo URI: ${t}`); } const i = n.get("data", { decode: true, string: false }); return this.crypto.decrypt(i, e.getEncryptionKey()); } async readTransactionData(t, e) { if (!e) { throw new Error(`No Silo URI specified`); } const r = await this.parseUri(e); const n = t.get("data", { decode: true, string: false }); return this.crypto.decrypt(n, r.getEncryptionKey()); } async parseUri(t) { const e = t.match(/^([a-z0-9-_]+)\.([0-9]+)/i); if (!e) { throw new Error(`Invalid Silo name, must be a name in the format of [a-z0-9]+.[0-9]+, e.g. 'bubble.7'`); } const r = e[1]; const i = Math.pow(2, parseInt(e[2])); const s = await this.hash(n.stringToBuffer(r), i); const a = n.bufferTob64(s.slice(0, 15)); const f = await this.hash(s.slice(16, 31), 1); return new o(t, a, f); } async hash(t, e) { let r = await this.crypto.hash(t); for(let n = 0; n < e - 1; n++){ r = await this.crypto.hash(r); } return r; } } e["default"] = i; class o { constructor(t, e, r){ this.uri = t; this.accessKey = e; this.encryptionKey = r; } getUri() { return this.uri; } getAccessKey() { return this.accessKey; } getEncryptionKey() { return this.encryptionKey; } } e.SiloResource = o; }), 6935: (function(t, e, r) { "use strict"; var n = (this && this.__await) || function(t) { return this instanceof n ? (this.v = t, this) : new n(t); }; var i = (this && this.__asyncGenerator) || function(t, e, r) { if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); var i = r.apply(t, e || []), o, s = []; return o = {}, a("next"), a("throw"), a("return"), o[Symbol.asyncIterator] = function() { return this; }, o; function a(t) { if (i[t]) o[t] = function(e) { return new Promise(function(r, n) { s.push([ t, e, r, n ]) > 1 || f(t, e); }); }; } function f(t, e) { try { u(i[t](e)); } catch (r) { h(s[0][3], r); } } function u(t) { t.value instanceof n ? Promise.resolve(t.value.v).then(c, l) : h(s[0][2], t); } function c(t) { f("next", t); } function l(t) { f("throw", t); } function h(t, e) { if (t(e), s.shift(), s.length) f(s[0][0], s[0][1]); } }; Object.defineProperty(e, "__esModule", ({ value: true })); const o = r(5498); const s = r(7825); const a = r(8244); const f = r(1246); r(1317); class u { constructor(t, e, r){ this.api = t; this.crypto = e; this.chunks = r; } getTransactionAnchor() { return this.api.get(`tx_anchor`, { transformResponse: [] }).then((t)=>{ return t.data; }); } getPrice(t, e) { let r = e ? `price/${t}/${e}` : `price/${t}`; return this.api.get(r, { transformResponse: [ function(t) { return t; } ] }).then((t)=>{ return t.data; }); } async get(t) { const e = await this.api.get(`tx/${t}`); if (e.status == 200) { const r = parseInt(e.data.data_size); if (e.data.format >= 2 && r > 0 && r <= 1024 * 1024 * 12) { const n = await this.getData(t); return new s.default(Object.assign(Object.assign({}, e.data), { data: n })); } return new s.default(Object.assign(Object.assign({}, e.data), { format: e.data.format || 1 })); } if (e.status == 404) { throw new o.default("TX_NOT_FOUND"); } if (e.status == 410) { throw new o.default("TX_FAILED"); } throw new o.default("TX_INVALID"); } fromRaw(t) { return new s.default(t); } async search(t, e) { return this.api.post(`arql`, { op: "equals", expr1: t, expr2: e }).then((t)=>{ if (!t.data) { return []; } return t.data; }); } getStatus(t) { return this.api.get(`tx/${t}/status`).then((t)=>{ if (t.status == 200) { return { status: 200, confirmed: t.data }; } return { status: t.status, confirmed: null }; }); } async getData(t, e) { let r = undefined; try { r = await this.chunks.downloadChunkedData(t); } catch (n) { console.error(`Error while trying to download chunked data for ${t}`); console.error(n); } if (!r) { console.warn(`Falling back to gateway cache for ${t}`); try { r = (await this.api.get(`/${t}`)).data; } catch (i) { console.error(`Error while trying to download contiguous data from gateway cache for ${t}`); console.error(i); } } if (!r) { throw new Error(`${t} was not found!`); } if (e && e.decode && !e.string) { return r; } if (e && e.decode && e.string) { return a.bufferToString(r); } return a.bufferTob64Url(r); } async sign(t, e, r) { if (!e && (typeof window === "undefined" || !window.arweaveWallet)) { throw new Error(`A new Arweave transaction must provide the jwk parameter.`); } else if (!e || e === "use_wallet") { try { const n = await window.arweaveWallet.getPermissions(); if (!n.includes("SIGN_TRANSACTION")) await window.arweaveWallet.connect([ "SIGN_TRANSACTION" ]); } catch (i) {} const o = await window.arweaveWallet.sign(t, r); t.setSignature({ id: o.id, owner: o.owner, reward: o.reward, tags: o.tags, signature: o.signature }); } else { t.setOwner(e.n); let s = await t.getSignatureData(); let f = await this.crypto.sign(e, s, r); let u = await this.crypto.hash(f); t.setSignature({ id: a.bufferTob64Url(u), owner: e.n, signature: a.bufferTob64Url(f) }); } } async verify(t) { const e = await t.getSignatureData(); const r = t.get("signature", { decode: true, string: false }); const n = a.bufferTob64Url(await this.crypto.hash(r)); if (t.id !== n) { throw new Error(`Invalid transaction signature or ID! The transaction ID doesn't match the expected SHA-256 hash of the signature.`); } return this.crypto.verify(t.owner, e, r); } async post(t) { if (typeof t === "string") { t = new s.default(JSON.parse(t)); } else if (typeof t.readInt32BE === "function") { t = new s.default(JSON.parse(t.toString())); } else if (typeof t === "object" && !(t instanceof s.default)) { t = new s.default(t); } if (!(t instanceof s.default)) { throw new Error(`Must be Transaction object`); } if (!t.chunks) { await t.prepareChunks(t.data); } const e = await this.getUploader(t, t.data); try { while(!e.isComplete){ await e.uploadChunk(); } } catch (r) { if (e.lastResponseStatus > 0) { return { status: e.lastResponseStatus, statusText: e.lastResponseError, data: { error: e.lastResponseError } }; } throw r; } return { status: 200, statusText: "OK", data: {} }; } async getUploader(t, e) { let r; if (e instanceof ArrayBuffer) { e = new Uint8Array(e); } if (t instanceof s.default) { if (!e) { e = t.data; } if (!(e instanceof Uint8Array)) { throw new Error("Data format is invalid"); } if (!t.chunks) { await t.prepareChunks(e); } r = new f.TransactionUploader(this.api, t); if (!r.data || r.data.length === 0) { r.data = e; } } else { if (typeof t === "string") { t = await f.TransactionUploader.fromTransactionId(this.api, t); } if (!e || !(e instanceof Uint8Array)) { throw new Error(`Must provide data when resuming upload`); } r = await f.TransactionUploader.fromSerialized(this.api, t, e); } return r; } upload(t, e) { return i(this, arguments, function* r() { const i = yield n(this.getUploader(t, e)); while(!i.isComplete){ yield n(i.uploadChunk()); yield yield n(i); } return yield n(i); }); } } e["default"] = u; }), 7927: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); const n = r(8244); r(1317); class i { constructor(t, e){ this.api = t; this.crypto = e; } getBalance(t) { return this.api.get(`wallet/${t}/balance`, { transformResponse: [ function(t) { return t; } ] }).then((t)=>{ return t.data; }); } getLastTransactionID(t) { return this.api.get(`wallet/${t}/last_tx`).then((t)=>{ return t.data; }); } generate() { return this.crypto.generateJWK(); } async jwkToAddress(t) { if (!t || t === "use_wallet") { return this.getAddress(); } else { return this.getAddress(t); } } async getAddress(t) { if (!t || t === "use_wallet") { try { await window.arweaveWallet.connect([ "ACCESS_ADDRESS" ]); } catch (e) {} return window.arweaveWallet.getActiveAddress(); } else { return this.ownerToAddress(t.n); } } async ownerToAddress(t) { return n.bufferTob64Url(await this.crypto.hash(n.b64UrlToBuffer(t))); } } e["default"] = i; }), 9809: (function(t, e, r) { "use strict"; const n = e; n.bignum = r(3550); n.define = (r(2500).define); n.base = r(1979); n.constants = r(6826); n.decoders = r(8307); n.encoders = r(6579); }), 2500: (function(t, e, r) { "use strict"; const n = r(6579); const i = r(8307); const o = r(5717); const s = e; s.define = function t(e, r) { return new a(e, r); }; function a(t, e) { this.name = t; this.body = e; this.decoders = {}; this.encoders = {}; } a.prototype._createNamed = function t(e) { const r = this.name; function n(t) { this._initNamed(t, r); } o(n, e); n.prototype._initNamed = function t(r, n) { e.call(this, r, n); }; return new n(this); }; a.prototype._getDecoder = function t(e) { e = e || 'der'; if (!this.decoders.hasOwnProperty(e)) this.decoders[e] = this._createNamed(i[e]); return this.decoders[e]; }; a.prototype.decode = function t(e, r, n) { return this._getDecoder(r).decode(e, n); }; a.prototype._getEncoder = function t(e) { e = e || 'der'; if (!this.encoders.hasOwnProperty(e)) this.encoders[e] = this._createNamed(n[e]); return this.encoders[e]; }; a.prototype.encode = function t(e, r, n) { return this._getEncoder(r).encode(e, n); }; }), 6625: (function(t, e, r) { "use strict"; const n = r(5717); const i = (r(8465).b); const o = (r(2399).Buffer); function s(t, e) { i.call(this, e); if (!o.isBuffer(t)) { this.error('Input not Buffer'); return; } this.base = t; this.offset = 0; this.length = t.length; } n(s, i); e.C = s; s.isDecoderBuffer = function t(e) { if (e instanceof s) { return true; } const r = typeof e === 'object' && o.isBuffer(e.base) && e.constructor.name === 'DecoderBuffer' && typeof e.offset === 'number' && typeof e.length === 'number' && typeof e.save === 'function' && typeof e.restore === 'function' && typeof e.isEmpty === 'function' && typeof e.readUInt8 === 'function' && typeof e.skip === 'function' && typeof e.raw === 'function'; return r; }; s.prototype.save = function t() { return { offset: this.offset, reporter: i.prototype.save.call(this) }; }; s.prototype.restore = function t(e) { const r = new s(this.base); r.offset = e.offset; r.length = this.offset; this.offset = e.offset; i.prototype.restore.call(this, e.reporter); return r; }; s.prototype.isEmpty = function t() { return this.offset === this.length; }; s.prototype.readUInt8 = function t(e) { if (this.offset + 1 <= this.length) return this.base.readUInt8(this.offset++, true); else return this.error(e || 'DecoderBuffer overrun'); }; s.prototype.skip = function t(e, r) { if (!(this.offset + e <= this.length)) return this.error(r || 'DecoderBuffer overrun'); const n = new s(this.base); n._reporterState = this._reporterState; n.offset = this.offset; n.length = this.offset + e; this.offset += e; return n; }; s.prototype.raw = function t(e) { return this.base.slice(e ? e.offset : this.offset, this.length); }; function a(t, e) { if (Array.isArray(t)) { this.length = 0; this.value = t.map(function(t) { if (!a.isEncoderBuffer(t)) t = new a(t, e); this.length += t.length; return t; }, this); } else if (typeof t === 'number') { if (!(0 <= t && t <= 0xff)) return e.error('non-byte EncoderBuffer value'); this.value = t; this.length = 1; } else if (typeof t === 'string') { this.value = t; this.length = o.byteLength(t); } else if (o.isBuffer(t)) { this.value = t; this.length = t.length; } else { return e.error('Unsupported type: ' + typeof t); } } e.R = a; a.isEncoderBuffer = function t(e) { if (e instanceof a) { return true; } const r = typeof e === 'object' && e.constructor.name === 'EncoderBuffer' && typeof e.length === 'number' && typeof e.join === 'function'; return r; }; a.prototype.join = function t(e, r) { if (!e) e = o.alloc(this.length); if (!r) r = 0; if (this.length === 0) return e; if (Array.isArray(this.value)) { this.value.forEach(function(t) { t.join(e, r); r += t.length; }); } else { if (typeof this.value === 'number') e[r] = this.value; else if (typeof this.value === 'string') e.write(this.value, r); else if (o.isBuffer(this.value)) this.value.copy(e, r); r += this.length; } return e; }; }), 1979: (function(t, e, r) { "use strict"; const n = e; n.Reporter = (r(8465).b); n.DecoderBuffer = (r(6625).C); n.EncoderBuffer = (r(6625).R); n.Node = r(1949); }), 1949: (function(t, e, r) { "use strict"; const n = (r(8465).b); const i = (r(6625).R); const o = (r(6625).C); const s = r(9746); const a = [ 'seq', 'seqof', 'set', 'setof', 'objid', 'bool', 'gentime', 'utctime', 'null_', 'enum', 'int', 'objDesc', 'bitstr', 'bmpstr', 'charstr', 'genstr', 'graphstr', 'ia5str', 'iso646str', 'numstr', 'octstr', 'printstr', 't61str', 'unistr', 'utf8str', 'videostr' ]; const f = [ 'key', 'obj', 'use', 'optional', 'explicit', 'implicit', 'def', 'choice', 'any', 'contains' ].concat(a); const u = [ '_peekTag', '_decodeTag', '_use', '_decodeStr', '_decodeObjid', '_decodeTime', '_decodeNull', '_decodeInt', '_decodeBool', '_decodeList', '_encodeComposite', '_encodeStr', '_encodeObjid', '_encodeTime', '_encodeNull', '_encodeInt', '_encodeBool' ]; function c(t, e, r) { const n = {}; this._baseState = n; n.name = r; n.enc = t; n.parent = e || null; n.children = null; n.tag = null; n.args = null; n.reverseArgs = null; n.choice = null; n.optional = false; n.any = false; n.obj = false; n.use = null; n.useDecoder = null; n.key = null; n['default'] = null; n.explicit = null; n.implicit = null; n.contains = null; if (!n.parent) { n.children = []; this._wrap(); } } t.exports = c; const l = [ 'enc', 'parent', 'children', 'tag', 'args', 'reverseArgs', 'choice', 'optional', 'any', 'obj', 'use', 'alteredUse', 'key', 'default', 'explicit', 'implicit', 'contains' ]; c.prototype.clone = function t() { const e = this._baseState; const r = {}; l.forEach(function(t) { r[t] = e[t]; }); const n = new this.constructor(r.parent); n._baseState = r; return n; }; c.prototype._wrap = function t() { const e = this._baseState; f.forEach(function(t) { this[t] = function r() { const n = new this.constructor(this); e.children.push(n); return n[t].apply(n, arguments); }; }, this); }; c.prototype._init = function t(e) { const r = this._baseState; s(r.parent === null); e.call(this); r.children = r.children.filter(function(t) { return t._baseState.parent === this; }, this); s.equal(r.children.length, 1, 'Root node can have only one child'); }; c.prototype._useArgs = function t(e) { const r = this._baseState; const n = e.filter(function(t) { return t instanceof this.constructor; }, this); e = e.filter(function(t) { return !(t instanceof this.constructor); }, this); if (n.length !== 0) { s(r.children === null); r.children = n; n.forEach(function(t) { t._baseState.parent = this; }, this); } if (e.length !== 0) { s(r.args === null); r.args = e; r.reverseArgs = e.map(function(t) { if (typeof t !== 'object' || t.constructor !== Object) return t; const e = {}; Object.keys(t).forEach(function(r) { if (r == (r | 0)) r |= 0; const n = t[r]; e[n] = r; }); return e; }); } }; u.forEach(function(t) { c.prototype[t] = function e() { const r = this._baseState; throw new Error(t + ' not implemented for encoding: ' + r.enc); }; }); a.forEach(function(t) { c.prototype[t] = function e() { const r = this._baseState; const n = Array.prototype.slice.call(arguments); s(r.tag === null); r.tag = t; this._useArgs(n); return this; }; }); c.prototype.use = function t(e) { s(e); const r = this._baseState; s(r.use === null); r.use = e; return this; }; c.prototype.optional = function t() { const e = this._baseState; e.optional = true; return this; }; c.prototype.def = function t(e) { const r = this._baseState; s(r['default'] === null); r['default'] = e; r.optional = true; return this; }; c.prototype.explicit = function t(e) { const r = this._baseState; s(r.explicit === null && r.implicit === null); r.explicit = e; return this; }; c.prototype.implicit = function t(e) { const r = this._baseState; s(r.explicit === null && r.implicit === null); r.implicit = e; return this; }; c.prototype.obj = function t() { const e = this._baseState; const r = Array.prototype.slice.call(arguments); e.obj = true; if (r.length !== 0) this._useArgs(r); return this; }; c.prototype.key = function t(e) { const r = this._baseState; s(r.key === null); r.key = e; return this; }; c.prototype.any = function t() { const e = this._baseState; e.any = true; return this; }; c.prototype.choice = function t(e) { const r = this._baseState; s(r.choice === null); r.choice = e; this._useArgs(Object.keys(e).map(function(t) { return e[t]; })); return this; }; c.prototype.contains = function t(e) { const r = this._baseState; s(r.use === null); r.contains = e; return this; }; c.prototype._decode = function t(e, r) { const n = this._baseState; if (n.parent === null) return e.wrapResult(n.children[0]._decode(e, r)); let i = n['default']; let s = true; let a = null; if (n.key !== null) a = e.enterKey(n.key); if (n.optional) { let f = null; if (n.explicit !== null) f = n.explicit; else if (n.implicit !== null) f = n.implicit; else if (n.tag !== null) f = n.tag; if (f === null && !n.any) { const u = e.save(); try { if (n.choice === null) this._decodeGeneric(n.tag, e, r); else this._decodeChoice(e, r); s = true; } catch (c) { s = false; } e.restore(u); } else { s = this._peekTag(e, f, n.any); if (e.isError(s)) return s; } } let l; if (n.obj && s) l = e.enterObject(); if (s) { if (n.explicit !== null) { const h = this._decodeTag(e, n.explicit); if (e.isError(h)) return h; e = h; } const d = e.offset; if (n.use === null && n.choice === null) { let p; if (n.any) p = e.save(); const g = this._decodeTag(e, n.implicit !== null ? n.implicit : n.tag, n.any); if (e.isError(g)) return g; if (n.any) i = e.raw(p); else e = g; } if (r && r.track && n.tag !== null) r.track(e.path(), d, e.length, 'tagged'); if (r && r.track && n.tag !== null) r.track(e.path(), e.offset, e.length, 'content'); if (n.any) {} else if (n.choice === null) { i = this._decodeGeneric(n.tag, e, r); } else { i = this._decodeChoice(e, r); } if (e.isError(i)) return i; if (!n.any && n.choice === null && n.children !== null) { n.children.forEach(function t(n) { n._decode(e, r); }); } if (n.contains && (n.tag === 'octstr' || n.tag === 'bitstr')) { const b = new o(i); i = this._getUse(n.contains, e._reporterState.obj)._decode(b, r); } } if (n.obj && s) i = e.leaveObject(l); if (n.key !== null && (i !== null || s === true)) e.leaveKey(a, n.key, i); else if (a !== null) e.exitKey(a); return i; }; c.prototype._decodeGeneric = function t(e, r, n) { const i = this._baseState; if (e === 'seq' || e === 'set') return null; if (e === 'seqof' || e === 'setof') return this._decodeList(r, e, i.args[0], n); else if (/str$/.test(e)) return this._decodeStr(r, e, n); else if (e === 'objid' && i.args) return this._decodeObjid(r, i.args[0], i.args[1], n); else if (e === 'objid') return this._decodeObjid(r, null, null, n); else if (e === 'gentime' || e === 'utctime') return this._decodeTime(r, e, n); else if (e === 'null_') return this._decodeNull(r, n); else if (e === 'bool') return this._decodeBool(r, n); else if (e === 'objDesc') return this._decodeStr(r, e, n); else if (e === 'int' || e === 'enum') return this._decodeInt(r, i.args && i.args[0], n); if (i.use !== null) { return this._getUse(i.use, r._reporterState.obj)._decode(r, n); } else { return r.error('unknown tag: ' + e); } }; c.prototype._getUse = function t(e, r) { const n = this._baseState; n.useDecoder = this._use(e, r); s(n.useDecoder._baseState.parent === null); n.useDecoder = n.useDecoder._baseState.children[0]; if (n.implicit !== n.useDecoder._baseState.implicit) { n.useDecoder = n.useDecoder.clone(); n.useDecoder._baseState.implicit = n.implicit; } return n.useDecoder; }; c.prototype._decodeChoice = function t(e, r) { const n = this._baseState; let i = null; let o = false; Object.keys(n.choice).some(function(t) { const s = e.save(); const a = n.choice[t]; try { const f = a._decode(e, r); if (e.isError(f)) return false; i = { type: t, value: f }; o = true; } catch (u) { e.restore(s); return false; } return true; }, this); if (!o) return e.error('Choice not matched'); return i; }; c.prototype._createEncoderBuffer = function t(e) { return new i(e, this.reporter); }; c.prototype._encode = function t(e, r, n) { const i = this._baseState; if (i['default'] !== null && i['default'] === e) return; const o = this._encodeValue(e, r, n); if (o === undefined) return; if (this._skipDefault(o, r, n)) return; return o; }; c.prototype._encodeValue = function t(e, r, i) { const o = this._baseState; if (o.parent === null) return o.children[0]._encode(e, r || new n()); let s = null; this.reporter = r; if (o.optional && e === undefined) { if (o['default'] !== null) e = o['default']; else return; } let a = null; let f = false; if (o.any) { s = this._createEncoderBuffer(e); } else if (o.choice) { s = this._encodeChoice(e, r); } else if (o.contains) { a = this._getUse(o.contains, i)._encode(e, r); f = true; } else if (o.children) { a = o.children.map(function(t) { if (t._baseState.tag === 'null_') return t._encode(null, r, e); if (t._baseState.key === null) return r.error('Child should have a key'); const n = r.enterKey(t._baseState.key); if (typeof e !== 'object') return r.error('Child expected, but input is not object'); const i = t._encode(e[t._baseState.key], r, e); r.leaveKey(n); return i; }, this).filter(function(t) { return t; }); a = this._createEncoderBuffer(a); } else { if (o.tag === 'seqof' || o.tag === 'setof') { if (!(o.args && o.args.length === 1)) return r.error('Too many args for : ' + o.tag); if (!Array.isArray(e)) return r.error('seqof/setof, but data is not Array'); const u = this.clone(); u._baseState.implicit = null; a = this._createEncoderBuffer(e.map(function(t) { const n = this._baseState; return this._getUse(n.args[0], e)._encode(t, r); }, u)); } else if (o.use !== null) { s = this._getUse(o.use, i)._encode(e, r); } else { a = this._encodePrimitive(o.tag, e); f = true; } } if (!o.any && o.choice === null) { const c = o.implicit !== null ? o.implicit : o.tag; const l = o.implicit === null ? 'universal' : 'context'; if (c === null) { if (o.use === null) r.error('Tag could be omitted only for .use()'); } else { if (o.use === null) s = this._encodeComposite(c, f, l, a); } } if (o.explicit !== null) s = this._encodeComposite(o.explicit, false, 'context', s); return s; }; c.prototype._encodeChoice = function t(e, r) { const n = this._baseState; const i = n.choice[e.type]; if (!i) { s(false, e.type + ' not found in ' + JSON.stringify(Object.keys(n.choice))); } return i._encode(e.value, r); }; c.prototype._encodePrimitive = function t(e, r) { const n = this._baseState; if (/str$/.test(e)) return this._encodeStr(r, e); else if (e === 'objid' && n.args) return this._encodeObjid(r, n.reverseArgs[0], n.args[1]); else if (e === 'objid') return this._encodeObjid(r, null, null); else if (e === 'gentime' || e === 'utctime') return this._encodeTime(r, e); else if (e === 'null_') return this._encodeNull(); else if (e === 'int' || e === 'enum') return this._encodeInt(r, n.args && n.reverseArgs[0]); else if (e === 'bool') return this._encodeBool(r); else if (e === 'objDesc') return this._encodeStr(r, e); else throw new Error('Unsupported tag: ' + e); }; c.prototype._isNumstr = function t(e) { return /^[0-9 ]*$/.test(e); }; c.prototype._isPrintstr = function t(e) { return /^[A-Za-z0-9 '()+,-./:=?]*$/.test(e); }; }), 8465: (function(t, e, r) { "use strict"; const n = r(5717); function i(t) { this._reporterState = { obj: null, path: [], options: t || {}, errors: [] }; } e.b = i; i.prototype.isError = function t(e) { return e instanceof o; }; i.prototype.save = function t() { const e = this._reporterState; return { obj: e.obj, pathLen: e.path.length }; }; i.prototype.restore = function t(e) { const r = this._reporterState; r.obj = e.obj; r.path = r.path.slice(0, e.pathLen); }; i.prototype.enterKey = function t(e) { return this._reporterState.path.push(e); }; i.prototype.exitKey = function t(e) { const r = this._reporterState; r.path = r.path.slice(0, e - 1); }; i.prototype.leaveKey = function t(e, r, n) { const i = this._reporterState; this.exitKey(e); if (i.obj !== null) i.obj[r] = n; }; i.prototype.path = function t() { return this._reporterState.path.join('/'); }; i.prototype.enterObject = function t() { const e = this._reporterState; const r = e.obj; e.obj = {}; return r; }; i.prototype.leaveObject = function t(e) { const r = this._reporterState; const n = r.obj; r.obj = e; return n; }; i.prototype.error = function t(e) { let r; const n = this._reporterState; const i = e instanceof o; if (i) { r = e; } else { r = new o(n.path.map(function(t) { return '[' + JSON.stringify(t) + ']'; }).join(''), e.message || e, e.stack); } if (!n.options.partial) throw r; if (!i) n.errors.push(r); return r; }; i.prototype.wrapResult = function t(e) { const r = this._reporterState; if (!r.options.partial) return e; return { result: this.isError(e) ? null : e, errors: r.errors }; }; function o(t, e) { this.path = t; this.rethrow(e); } n(o, Error); o.prototype.rethrow = function t(e) { this.message = e + ' at: ' + (this.path || '(shallow)'); if (Error.captureStackTrace) Error.captureStackTrace(this, o); if (!this.stack) { try { throw new Error(this.message); } catch (r) { this.stack = r.stack; } } return this; }; }), 160: (function(t, e) { "use strict"; function r(t) { const e = {}; Object.keys(t).forEach(function(r) { if ((r | 0) == r) r = r | 0; const n = t[r]; e[n] = r; }); return e; } e.tagClass = { 0: 'universal', 1: 'application', 2: 'context', 3: 'private' }; e.tagClassByName = r(e.tagClass); e.tag = { 0x00: 'end', 0x01: 'bool', 0x02: 'int', 0x03: 'bitstr', 0x04: 'octstr', 0x05: 'null_', 0x06: 'objid', 0x07: 'objDesc', 0x08: 'external', 0x09: 'real', 0x0a: 'enum', 0x0b: 'embed', 0x0c: 'utf8str', 0x0d: 'relativeOid', 0x10: 'seq', 0x11: 'set', 0x12: 'numstr', 0x13: 'printstr', 0x14: 't61str', 0x15: 'videostr', 0x16: 'ia5str', 0x17: 'utctime', 0x18: 'gentime', 0x19: 'graphstr', 0x1a: 'iso646str', 0x1b: 'genstr', 0x1c: 'unistr', 0x1d: 'charstr', 0x1e: 'bmpstr' }; e.tagByName = r(e.tag); }), 6826: (function(t, e, r) { "use strict"; const n = e; n._reverse = function t(e) { const r = {}; Object.keys(e).forEach(function(t) { if ((t | 0) == t) t = t | 0; const n = e[t]; r[n] = t; }); return r; }; n.der = r(160); }), 1671: (function(t, e, r) { "use strict"; const n = r(5717); const i = r(3550); const o = (r(6625).C); const s = r(1949); const a = r(160); function f(t) { this.enc = 'der'; this.name = t.name; this.entity = t; this.tree = new u(); this.tree._init(t.body); } t.exports = f; f.prototype.decode = function t(e, r) { if (!o.isDecoderBuffer(e)) { e = new o(e, r); } return this.tree._decode(e, r); }; function u(t) { s.call(this, 'der', t); } n(u, s); u.prototype._peekTag = function t(e, r, n) { if (e.isEmpty()) return false; const i = e.save(); const o = c(e, 'Failed to peek tag: "' + r + '"'); if (e.isError(o)) return o; e.restore(i); return o.tag === r || o.tagStr === r || (o.tagStr + 'of') === r || n; }; u.prototype._decodeTag = function t(e, r, n) { const i = c(e, 'Failed to decode tag of "' + r + '"'); if (e.isError(i)) return i; let o = l(e, i.primitive, 'Failed to get length of "' + r + '"'); if (e.isError(o)) return o; if (!n && i.tag !== r && i.tagStr !== r && i.tagStr + 'of' !== r) { return e.error('Failed to match tag: "' + r + '"'); } if (i.primitive || o !== null) return e.skip(o, 'Failed to match body of: "' + r + '"'); const s = e.save(); const a = this._skipUntilEnd(e, 'Failed to skip indefinite length body: "' + this.tag + '"'); if (e.isError(a)) return a; o = e.offset - s.offset; e.restore(s); return e.skip(o, 'Failed to match body of: "' + r + '"'); }; u.prototype._skipUntilEnd = function t(e, r) { for(;;){ const n = c(e, r); if (e.isError(n)) return n; const i = l(e, n.primitive, r); if (e.isError(i)) return i; let o; if (n.primitive || i !== null) o = e.skip(i); else o = this._skipUntilEnd(e, r); if (e.isError(o)) return o; if (n.tagStr === 'end') break; } }; u.prototype._decodeList = function t(e, r, n, i) { const o = []; while(!e.isEmpty()){ const s = this._peekTag(e, 'end'); if (e.isError(s)) return s; const a = n.decode(e, 'der', i); if (e.isError(a) && s) break; o.push(a); } return o; }; u.prototype._decodeStr = function t(e, r) { if (r === 'bitstr') { const n = e.readUInt8(); if (e.isError(n)) return n; return { unused: n, data: e.raw() }; } else if (r === 'bmpstr') { const i = e.raw(); if (i.length % 2 === 1) return e.error('Decoding of string type: bmpstr length mismatch'); let o = ''; for(let s = 0; s < i.length / 2; s++){ o += String.fromCharCode(i.readUInt16BE(s * 2)); } return o; } else if (r === 'numstr') { const a = e.raw().toString('ascii'); if (!this._isNumstr(a)) { return e.error('Decoding of string type: ' + 'numstr unsupported characters'); } return a; } else if (r === 'octstr') { return e.raw(); } else if (r === 'objDesc') { return e.raw(); } else if (r === 'printstr') { const f = e.raw().toString('ascii'); if (!this._isPrintstr(f)) { return e.error('Decoding of string type: ' + 'printstr unsupported characters'); } return f; } else if (/str$/.test(r)) { return e.raw().toString(); } else { return e.error('Decoding of string type: ' + r + ' unsupported'); } }; u.prototype._decodeObjid = function t(e, r, n) { let i; const o = []; let s = 0; let a = 0; while(!e.isEmpty()){ a = e.readUInt8(); s <<= 7; s |= a & 0x7f; if ((a & 0x80) === 0) { o.push(s); s = 0; } } if (a & 0x80) o.push(s); const f = (o[0] / 40) | 0; const u = o[0] % 40; if (n) i = o; else i = [ f, u ].concat(o.slice(1)); if (r) { let c = r[i.join(' ')]; if (c === undefined) c = r[i.join('.')]; if (c !== undefined) i = c; } return i; }; u.prototype._decodeTime = function t(e, r) { const n = e.raw().toString(); let i; let o; let s; let a; let f; let u; if (r === 'gentime') { i = n.slice(0, 4) | 0; o = n.slice(4, 6) | 0; s = n.slice(6, 8) | 0; a = n.slice(8, 10) | 0; f = n.slice(10, 12) | 0; u = n.slice(12, 14) | 0; } else if (r === 'utctime') { i = n.slice(0, 2) | 0; o = n.slice(2, 4) | 0; s = n.slice(4, 6) | 0; a = n.slice(6, 8) | 0; f = n.slice(8, 10) | 0; u = n.slice(10, 12) | 0; if (i < 70) i = 2000 + i; else i = 1900 + i; } else { return e.error('Decoding ' + r + ' time is not supported yet'); } return Date.UTC(i, o - 1, s, a, f, u, 0); }; u.prototype._decodeNull = function t() { return null; }; u.prototype._decodeBool = function t(e) { const r = e.readUInt8(); if (e.isError(r)) return r; else return r !== 0; }; u.prototype._decodeInt = function t(e, r) { const n = e.raw(); let o = new i(n); if (r) o = r[o.toString(10)] || o; return o; }; u.prototype._use = function t(e, r) { if (typeof e === 'function') e = e(r); return e._getDecoder('der').tree; }; function c(t, e) { let r = t.readUInt8(e); if (t.isError(r)) return r; const n = a.tagClass[r >> 6]; const i = (r & 0x20) === 0; if ((r & 0x1f) === 0x1f) { let o = r; r = 0; while((o & 0x80) === 0x80){ o = t.readUInt8(e); if (t.isError(o)) return o; r <<= 7; r |= o & 0x7f; } } else { r &= 0x1f; } const s = a.tag[r]; return { cls: n, primitive: i, tag: r, tagStr: s }; } function l(t, e, r) { let n = t.readUInt8(r); if (t.isError(n)) return n; if (!e && n === 0x80) return null; if ((n & 0x80) === 0) { return n; } const i = n & 0x7f; if (i > 4) return t.error('length octect is too long'); n = 0; for(let o = 0; o < i; o++){ n <<= 8; const s = t.readUInt8(r); if (t.isError(s)) return s; n |= s; } return n; } }), 8307: (function(t, e, r) { "use strict"; const n = e; n.der = r(1671); n.pem = r(9631); }), 9631: (function(t, e, r) { "use strict"; const n = r(5717); const i = (r(2399).Buffer); const o = r(1671); function s(t) { o.call(this, t); this.enc = 'pem'; } n(s, o); t.exports = s; s.prototype.decode = function t(e, r) { const n = e.toString().split(/[\r\n]+/g); const s = r.label.toUpperCase(); const a = /^-----(BEGIN|END) ([^-]+)-----$/; let f = -1; let u = -1; for(let c = 0; c < n.length; c++){ const l = n[c].match(a); if (l === null) continue; if (l[2] !== s) continue; if (f === -1) { if (l[1] !== 'BEGIN') break; f = c; } else { if (l[1] !== 'END') break; u = c; break; } } if (f === -1 || u === -1) throw new Error('PEM section not found for: ' + s); const h = n.slice(f + 1, u).join(''); h.replace(/[^a-z0-9+/=]+/gi, ''); const d = i.from(h, 'base64'); return o.prototype.decode.call(this, d, r); }; }), 6984: (function(t, e, r) { "use strict"; const n = r(5717); const i = (r(2399).Buffer); const o = r(1949); const s = r(160); function a(t) { this.enc = 'der'; this.name = t.name; this.entity = t; this.tree = new f(); this.tree._init(t.body); } t.exports = a; a.prototype.encode = function t(e, r) { return this.tree._encode(e, r).join(); }; function f(t) { o.call(this, 'der', t); } n(f, o); f.prototype._encodeComposite = function t(e, r, n, o) { const s = c(e, r, n, this.reporter); if (o.length < 0x80) { const a = i.alloc(2); a[0] = s; a[1] = o.length; return this._createEncoderBuffer([ a, o ]); } let f = 1; for(let u = o.length; u >= 0x100; u >>= 8)f++; const l = i.alloc(1 + 1 + f); l[0] = s; l[1] = 0x80 | f; for(let h = 1 + f, d = o.length; d > 0; h--, d >>= 8)l[h] = d & 0xff; return this._createEncoderBuffer([ l, o ]); }; f.prototype._encodeStr = function t(e, r) { if (r === 'bitstr') { return this._createEncoderBuffer([ e.unused | 0, e.data ]); } else if (r === 'bmpstr') { const n = i.alloc(e.length * 2); for(let o = 0; o < e.length; o++){ n.writeUInt16BE(e.charCodeAt(o), o * 2); } return this._createEncoderBuffer(n); } else if (r === 'numstr') { if (!this._isNumstr(e)) { return this.reporter.error('Encoding of string type: numstr supports ' + 'only digits and space'); } return this._createEncoderBuffer(e); } else if (r === 'printstr') { if (!this._isPrintstr(e)) { return this.reporter.error('Encoding of string type: printstr supports ' + 'only latin upper and lower case letters, ' + 'digits, space, apostrophe, left and rigth ' + 'parenthesis, plus sign, comma, hyphen, ' + 'dot, slash, colon, equal sign, ' + 'question mark'); } return this._createEncoderBuffer(e); } else if (/str$/.test(r)) { return this._createEncoderBuffer(e); } else if (r === 'objDesc') { return this._createEncoderBuffer(e); } else { return this.reporter.error('Encoding of string type: ' + r + ' unsupported'); } }; f.prototype._encodeObjid = function t(e, r, n) { if (typeof e === 'string') { if (!r) return this.reporter.error('string objid given, but no values map found'); if (!r.hasOwnProperty(e)) return this.reporter.error('objid not found in values map'); e = r[e].split(/[\s.]+/g); for(let o = 0; o < e.length; o++)e[o] |= 0; } else if (Array.isArray(e)) { e = e.slice(); for(let s = 0; s < e.length; s++)e[s] |= 0; } if (!Array.isArray(e)) { return this.reporter.error('objid() should be either array or string, ' + 'got: ' + JSON.stringify(e)); } if (!n) { if (e[1] >= 40) return this.reporter.error('Second objid identifier OOB'); e.splice(0, 2, e[0] * 40 + e[1]); } let a = 0; for(let f = 0; f < e.length; f++){ let u = e[f]; for(a++; u >= 0x80; u >>= 7)a++; } const c = i.alloc(a); let l = c.length - 1; for(let h = e.length - 1; h >= 0; h--){ let d = e[h]; c[l--] = d & 0x7f; while((d >>= 7) > 0)c[l--] = 0x80 | (d & 0x7f); } return this._createEncoderBuffer(c); }; function u(t) { if (t < 10) return '0' + t; else return t; } f.prototype._encodeTime = function t(e, r) { let n; const i = new Date(e); if (r === 'gentime') { n = [ u(i.getUTCFullYear()), u(i.getUTCMonth() + 1), u(i.getUTCDate()), u(i.getUTCHours()), u(i.getUTCMinutes()), u(i.getUTCSeconds()), 'Z' ].join(''); } else if (r === 'utctime') { n = [ u(i.getUTCFullYear() % 100), u(i.getUTCMonth() + 1), u(i.getUTCDate()), u(i.getUTCHours()), u(i.getUTCMinutes()), u(i.getUTCSeconds()), 'Z' ].join(''); } else { this.reporter.error('Encoding ' + r + ' time is not supported yet'); } return this._encodeStr(n, 'octstr'); }; f.prototype._encodeNull = function t() { return this._createEncoderBuffer(''); }; f.prototype._encodeInt = function t(e, r) { if (typeof e === 'string') { if (!r) return this.reporter.error('String int or enum given, but no values map'); if (!r.hasOwnProperty(e)) { return this.reporter.error('Values map doesn\'t contain: ' + JSON.stringify(e)); } e = r[e]; } if (typeof e !== 'number' && !i.isBuffer(e)) { const n = e.toArray(); if (!e.sign && n[0] & 0x80) { n.unshift(0); } e = i.from(n); } if (i.isBuffer(e)) { let o = e.length; if (e.length === 0) o++; const s = i.alloc(o); e.copy(s); if (e.length === 0) s[0] = 0; return this._createEncoderBuffer(s); } if (e < 0x80) return this._createEncoderBuffer(e); if (e < 0x100) return this._createEncoderBuffer([ 0, e ]); let a = 1; for(let f = e; f >= 0x100; f >>= 8)a++; const u = new Array(a); for(let c = u.length - 1; c >= 0; c--){ u[c] = e & 0xff; e >>= 8; } if (u[0] & 0x80) { u.unshift(0); } return this._createEncoderBuffer(i.from(u)); }; f.prototype._encodeBool = function t(e) { return this._createEncoderBuffer(e ? 0xff : 0); }; f.prototype._use = function t(e, r) { if (typeof e === 'function') e = e(r); return e._getEncoder('der').tree; }; f.prototype._skipDefault = function t(e, r, n) { const i = this._baseState; let o; if (i['default'] === null) return false; const s = e.join(); if (i.defaultBuffer === undefined) i.defaultBuffer = this._encodeValue(i['default'], r, n).join(); if (s.length !== i.defaultBuffer.length) return false; for(o = 0; o < s.length; o++)if (s[o] !== i.defaultBuffer[o]) return false; return true; }; function c(t, e, r, n) { let i; if (t === 'seqof') t = 'seq'; else if (t === 'setof') t = 'set'; if (s.tagByName.hasOwnProperty(t)) i = s.tagByName[t]; else if (typeof t === 'number' && (t | 0) === t) i = t; else return n.error('Unknown tag: ' + t); if (i >= 0x1f) return n.error('Multi-octet tag encoding unsupported'); if (!e) i |= 0x20; i |= (s.tagClassByName[r || 'universal'] << 6); return i; } }), 6579: (function(t, e, r) { "use strict"; const n = e; n.der = r(6984); n.pem = r(2883); }), 2883: (function(t, e, r) { "use strict"; const n = r(5717); const i = r(6984); function o(t) { i.call(this, t); this.enc = 'pem'; } n(o, i); t.exports = o; o.prototype.encode = function t(e, r) { const n = i.prototype.encode.call(this, e); const o = n.toString('base64'); const s = [ '-----BEGIN ' + r.label + '-----' ]; for(let a = 0; a < o.length; a += 64)s.push(o.slice(a, a + 64)); s.push('-----END ' + r.label + '-----'); return s.join('\n'); }; }), 9669: (function(t, e, r) { t.exports = r(1609); }), 5448: (function(t, e, r) { "use strict"; var n = r(4867); var i = r(6026); var o = r(4372); var s = r(5327); var a = r(4097); var f = r(4109); var u = r(7985); var c = r(7874); var l = r(723); var h = r(644); var d = r(205); t.exports = function t(e) { return new Promise(function t(r, p) { var g = e.data; var b = e.headers; var v = e.responseType; var y; function m() { if (e.cancelToken) { e.cancelToken.unsubscribe(y); } if (e.signal) { e.signal.removeEventListener('abort', y); } } if (n.isFormData(g) && n.isStandardBrowserEnv()) { delete b['Content-Type']; } var w = new XMLHttpRequest(); if (e.auth) { var _ = e.auth.username || ''; var S = e.auth.password ? unescape(encodeURIComponent(e.auth.password)) : ''; b.Authorization = 'Basic ' + btoa(_ + ':' + S); } var E = a(e.baseURL, e.url); w.open(e.method.toUpperCase(), s(E, e.params, e.paramsSerializer), true); w.timeout = e.timeout; function x() { if (!w) { return; } var t = 'getAllResponseHeaders' in w ? f(w.getAllResponseHeaders()) : null; var n = !v || v === 'text' || v === 'json' ? w.responseText : w.response; var o = { data: n, status: w.status, statusText: w.statusText, headers: t, config: e, request: w }; i(function t(e) { r(e); m(); }, function t(e) { p(e); m(); }, o); w = null; } if ('onloadend' in w) { w.onloadend = x; } else { w.onreadystatechange = function t() { if (!w || w.readyState !== 4) { return; } if (w.status === 0 && !(w.responseURL && w.responseURL.indexOf('file:') === 0)) { return; } setTimeout(x); }; } w.onabort = function t() { if (!w) { return; } p(new l('Request aborted', l.ECONNABORTED, e, w)); w = null; }; w.onerror = function t() { p(new l('Network Error', l.ERR_NETWORK, e, w, w)); w = null; }; w.ontimeout = function t() { var r = e.timeout ? 'timeout of ' + e.timeout + 'ms exceeded' : 'timeout exceeded'; var n = e.transitional || c; if (e.timeoutErrorMessage) { r = e.timeoutErrorMessage; } p(new l(r, n.clarifyTimeoutError ? l.ETIMEDOUT : l.ECONNABORTED, e, w)); w = null; }; if (n.isStandardBrowserEnv()) { var M = (e.withCredentials || u(E)) && e.xsrfCookieName ? o.read(e.xsrfCookieName) : undefined; if (M) { b[e.xsrfHeaderName] = M; } } if ('setRequestHeader' in w) { n.forEach(b, function t(e, r) { if (typeof g === 'undefined' && r.toLowerCase() === 'content-type') { delete b[r]; } else { w.setRequestHeader(r, e); } }); } if (!n.isUndefined(e.withCredentials)) { w.withCredentials = !!e.withCredentials; } if (v && v !== 'json') { w.responseType = e.responseType; } if (typeof e.onDownloadProgress === 'function') { w.addEventListener('progress', e.onDownloadProgress); } if (typeof e.onUploadProgress === 'function' && w.upload) { w.upload.addEventListener('progress', e.onUploadProgress); } if (e.cancelToken || e.signal) { y = function(t) { if (!w) { return; } p(!t || (t && t.type) ? new h() : t); w.abort(); w = null; }; e.cancelToken && e.cancelToken.subscribe(y); if (e.signal) { e.signal.aborted ? y() : e.signal.addEventListener('abort', y); } } if (!g) { g = null; } var T = d(E); if (T && [ 'http', 'https', 'file' ].indexOf(T) === -1) { p(new l('Unsupported protocol ' + T + ':', l.ERR_BAD_REQUEST, e)); return; } w.send(g); }); }; }), 1609: (function(t, e, r) { "use strict"; var n = r(4867); var i = r(1849); var o = r(321); var s = r(7185); var a = r(5546); function f(t) { var e = new o(t); var r = i(o.prototype.request, e); n.extend(r, o.prototype, e); n.extend(r, e); r.create = function e(r) { return f(s(t, r)); }; return r; } var u = f(a); u.Axios = o; u.CanceledError = r(644); u.CancelToken = r(4972); u.isCancel = r(6502); u.VERSION = (r(7288).version); u.toFormData = r(7675); u.AxiosError = r(723); u.Cancel = u.CanceledError; u.all = function t(e) { return Promise.all(e); }; u.spread = r(8713); u.isAxiosError = r(6268); t.exports = u; t.exports["default"] = u; }), 4972: (function(t, e, r) { "use strict"; var n = r(644); function i(t) { if (typeof t !== 'function') { throw new TypeError('executor must be a function.'); } var e; this.promise = new Promise(function t(r) { e = r; }); var r = this; this.promise.then(function(t) { if (!r._listeners) return; var e; var n = r._listeners.length; for(e = 0; e < n; e++){ r._listeners[e](t); } r._listeners = null; }); this.promise.then = function(t) { var e; var n = new Promise(function(t) { r.subscribe(t); e = t; }).then(t); n.cancel = function t() { r.unsubscribe(e); }; return n; }; t(function t(i) { if (r.reason) { return; } r.reason = new n(i); e(r.reason); }); } i.prototype.throwIfRequested = function t() { if (this.reason) { throw this.reason; } }; i.prototype.subscribe = function t(e) { if (this.reason) { e(this.reason); return; } if (this._listeners) { this._listeners.push(e); } else { this._listeners = [ e ]; } }; i.prototype.unsubscribe = function t(e) { if (!this._listeners) { return; } var r = this._listeners.indexOf(e); if (r !== -1) { this._listeners.splice(r, 1); } }; i.source = function t() { var e; var r = new i(function t(r) { e = r; }); return { token: r, cancel: e }; }; t.exports = i; }), 644: (function(t, e, r) { "use strict"; var n = r(723); var i = r(4867); function o(t) { n.call(this, t == null ? 'canceled' : t, n.ERR_CANCELED); this.name = 'CanceledError'; } i.inherits(o, n, { __CANCEL__: true }); t.exports = o; }), 6502: (function(t) { "use strict"; t.exports = function t(e) { return !!(e && e.__CANCEL__); }; }), 321: (function(t, e, r) { "use strict"; var n = r(4867); var i = r(5327); var o = r(782); var s = r(3572); var a = r(7185); var f = r(4097); var u = r(4875); var c = u.validators; function l(t) { this.defaults = t; this.interceptors = { request: new o(), response: new o() }; } l.prototype.request = function t(e, r) { if (typeof e === 'string') { r = r || {}; r.url = e; } else { r = e || {}; } r = a(this.defaults, r); if (r.method) { r.method = r.method.toLowerCase(); } else if (this.defaults.method) { r.method = this.defaults.method.toLowerCase(); } else { r.method = 'get'; } var n = r.transitional; if (n !== undefined) { u.assertOptions(n, { silentJSONParsing: c.transitional(c.boolean), forcedJSONParsing: c.transitional(c.boolean), clarifyTimeoutError: c.transitional(c.boolean) }, false); } var i = []; var o = true; this.interceptors.request.forEach(function t(e) { if (typeof e.runWhen === 'function' && e.runWhen(r) === false) { return; } o = o && e.synchronous; i.unshift(e.fulfilled, e.rejected); }); var f = []; this.interceptors.response.forEach(function t(e) { f.push(e.fulfilled, e.rejected); }); var l; if (!o) { var h = [ s, undefined ]; Array.prototype.unshift.apply(h, i); h = h.concat(f); l = Promise.resolve(r); while(h.length){ l = l.then(h.shift(), h.shift()); } return l; } var d = r; while(i.length){ var p = i.shift(); var g = i.shift(); try { d = p(d); } catch (b) { g(b); break; } } try { l = s(d); } catch (v) { return Promise.reject(v); } while(f.length){ l = l.then(f.shift(), f.shift()); } return l; }; l.prototype.getUri = function t(e) { e = a(this.defaults, e); var r = f(e.baseURL, e.url); return i(r, e.params, e.paramsSerializer); }; n.forEach([ 'delete', 'get', 'head', 'options' ], function t(e) { l.prototype[e] = function(t, r) { return this.request(a(r || {}, { method: e, url: t, data: (r || {}).data })); }; }); n.forEach([ 'post', 'put', 'patch' ], function t(e) { function r(t) { return function r(n, i, o) { return this.request(a(o || {}, { method: e, headers: t ? { 'Content-Type': 'multipart/form-data' } : {}, url: n, data: i })); }; } l.prototype[e] = r(); l.prototype[e + 'Form'] = r(true); }); t.exports = l; }), 723: (function(t, e, r) { "use strict"; var n = r(4867); function i(t, e, r, n, i) { Error.call(this); this.message = t; this.name = 'AxiosError'; e && (this.code = e); r && (this.config = r); n && (this.request = n); i && (this.response = i); } n.inherits(i, Error, { toJSON: function t() { return { message: this.message, name: this.name, description: this.description, number: this.number, fileName: this.fileName, lineNumber: this.lineNumber, columnNumber: this.columnNumber, stack: this.stack, config: this.config, code: this.code, status: this.response && this.response.status ? this.response.status : null }; } }); var o = i.prototype; var s = {}; [ 'ERR_BAD_OPTION_VALUE', 'ERR_BAD_OPTION', 'ECONNABORTED', 'ETIMEDOUT', 'ERR_NETWORK', 'ERR_FR_TOO_MANY_REDIRECTS', 'ERR_DEPRECATED', 'ERR_BAD_RESPONSE', 'ERR_BAD_REQUEST', 'ERR_CANCELED' ].forEach(function(t) { s[t] = { value: t }; }); Object.defineProperties(i, s); Object.defineProperty(o, 'isAxiosError', { value: true }); i.from = function(t, e, r, s, a, f) { var u = Object.create(o); n.toFlatObject(t, u, function t(e) { return e !== Error.prototype; }); i.call(u, t.message, e, r, s, a); u.name = t.name; f && Object.assign(u, f); return u; }; t.exports = i; }), 782: (function(t, e, r) { "use strict"; var n = r(4867); function i() { this.handlers = []; } i.prototype.use = function t(e, r, n) { this.handlers.push({ fulfilled: e, rejected: r, synchronous: n ? n.synchronous : false, runWhen: n ? n.runWhen : null }); return this.handlers.length - 1; }; i.prototype.eject = function t(e) { if (this.handlers[e]) { this.handlers[e] = null; } }; i.prototype.forEach = function t(e) { n.forEach(this.handlers, function t(r) { if (r !== null) { e(r); } }); }; t.exports = i; }), 4097: (function(t, e, r) { "use strict"; var n = r(1793); var i = r(7303); t.exports = function t(e, r) { if (e && !n(r)) { return i(e, r); } return r; }; }), 3572: (function(t, e, r) { "use strict"; var n = r(4867); var i = r(8527); var o = r(6502); var s = r(5546); var a = r(644); function f(t) { if (t.cancelToken) { t.cancelToken.throwIfRequested(); } if (t.signal && t.signal.aborted) { throw new a(); } } t.exports = function t(e) { f(e); e.headers = e.headers || {}; e.data = i.call(e, e.data, e.headers, e.transformRequest); e.headers = n.merge(e.headers.common || {}, e.headers[e.method] || {}, e.headers); n.forEach([ 'delete', 'get', 'head', 'post', 'put', 'patch', 'common' ], function t(r) { delete e.headers[r]; }); var r = e.adapter || s.adapter; return r(e).then(function t(r) { f(e); r.data = i.call(e, r.data, r.headers, e.transformResponse); return r; }, function t(r) { if (!o(r)) { f(e); if (r && r.response) { r.response.data = i.call(e, r.response.data, r.response.headers, e.transformResponse); } } return Promise.reject(r); }); }; }), 7185: (function(t, e, r) { "use strict"; var n = r(4867); t.exports = function t(e, r) { r = r || {}; var i = {}; function o(t, e) { if (n.isPlainObject(t) && n.isPlainObject(e)) { return n.merge(t, e); } else if (n.isPlainObject(e)) { return n.merge({}, e); } else if (n.isArray(e)) { return e.slice(); } return e; } function s(t) { if (!n.isUndefined(r[t])) { return o(e[t], r[t]); } else if (!n.isUndefined(e[t])) { return o(undefined, e[t]); } } function a(t) { if (!n.isUndefined(r[t])) { return o(undefined, r[t]); } } function f(t) { if (!n.isUndefined(r[t])) { return o(undefined, r[t]); } else if (!n.isUndefined(e[t])) { return o(undefined, e[t]); } } function u(t) { if (t in r) { return o(e[t], r[t]); } else if (t in e) { return o(undefined, e[t]); } } var c = { 'url': a, 'method': a, 'data': a, 'baseURL': f, 'transformRequest': f, 'transformResponse': f, 'paramsSerializer': f, 'timeout': f, 'timeoutMessage': f, 'withCredentials': f, 'adapter': f, 'responseType': f, 'xsrfCookieName': f, 'xsrfHeaderName': f, 'onUploadProgress': f, 'onDownloadProgress': f, 'decompress': f, 'maxContentLength': f, 'maxBodyLength': f, 'beforeRedirect': f, 'transport': f, 'httpAgent': f, 'httpsAgent': f, 'cancelToken': f, 'socketPath': f, 'responseEncoding': f, 'validateStatus': u }; n.forEach(Object.keys(e).concat(Object.keys(r)), function t(e) { var r = c[e] || s; var o = r(e); (n.isUndefined(o) && r !== u) || (i[e] = o); }); return i; }; }), 6026: (function(t, e, r) { "use strict"; var n = r(723); t.exports = function t(e, r, i) { var o = i.config.validateStatus; if (!i.status || !o || o(i.status)) { e(i); } else { r(new n('Request failed with status code ' + i.status, [ n.ERR_BAD_REQUEST, n.ERR_BAD_RESPONSE ][Math.floor(i.status / 100) - 4], i.config, i.request, i)); } }; }), 8527: (function(t, e, r) { "use strict"; var n = r(4867); var i = r(5546); t.exports = function t(e, r, o) { var s = this || i; n.forEach(o, function t(n) { e = n.call(s, e, r); }); return e; }; }), 5546: (function(t, e, r) { "use strict"; var n = r(3454); var i = r(4867); var o = r(6016); var s = r(723); var a = r(7874); var f = r(7675); var u = { 'Content-Type': 'application/x-www-form-urlencoded' }; function c(t, e) { if (!i.isUndefined(t) && i.isUndefined(t['Content-Type'])) { t['Content-Type'] = e; } } function l() { var t; if (typeof XMLHttpRequest !== 'undefined') { t = r(5448); } else if (typeof n !== 'undefined' && Object.prototype.toString.call(n) === '[object process]') { t = r(5448); } return t; } function h(t, e, r) { if (i.isString(t)) { try { (e || JSON.parse)(t); return i.trim(t); } catch (n) { if (n.name !== 'SyntaxError') { throw n; } } } return (r || JSON.stringify)(t); } var d = { transitional: a, adapter: l(), transformRequest: [ function t(e, r) { o(r, 'Accept'); o(r, 'Content-Type'); if (i.isFormData(e) || i.isArrayBuffer(e) || i.isBuffer(e) || i.isStream(e) || i.isFile(e) || i.isBlob(e)) { return e; } if (i.isArrayBufferView(e)) { return e.buffer; } if (i.isURLSearchParams(e)) { c(r, 'application/x-www-form-urlencoded;charset=utf-8'); return e.toString(); } var n = i.isObject(e); var s = r && r['Content-Type']; var a; if ((a = i.isFileList(e)) || (n && s === 'multipart/form-data')) { var u = this.env && this.env.FormData; return f(a ? { 'files[]': e } : e, u && new u()); } else if (n || s === 'application/json') { c(r, 'application/json'); return h(e); } return e; } ], transformResponse: [ function t(e) { var r = this.transitional || d.transitional; var n = r && r.silentJSONParsing; var o = r && r.forcedJSONParsing; var a = !n && this.responseType === 'json'; if (a || (o && i.isString(e) && e.length)) { try { return JSON.parse(e); } catch (f) { if (a) { if (f.name === 'SyntaxError') { throw s.from(f, s.ERR_BAD_RESPONSE, this, null, this.response); } throw f; } } } return e; } ], timeout: 0, xsrfCookieName: 'XSRF-TOKEN', xsrfHeaderName: 'X-XSRF-TOKEN', maxContentLength: -1, maxBodyLength: -1, env: { FormData: r(1623) }, validateStatus: function t(e) { return e >= 200 && e < 300; }, headers: { common: { 'Accept': 'application/json, text/plain, */*' } } }; i.forEach([ 'delete', 'get', 'head' ], function t(e) { d.headers[e] = {}; }); i.forEach([ 'post', 'put', 'patch' ], function t(e) { d.headers[e] = i.merge(u); }); t.exports = d; }), 7874: (function(t) { "use strict"; t.exports = { silentJSONParsing: true, forcedJSONParsing: true, clarifyTimeoutError: false }; }), 7288: (function(t) { t.exports = { "version": "0.27.2" }; }), 1849: (function(t) { "use strict"; t.exports = function t(e, r) { return function t() { var n = new Array(arguments.length); for(var i = 0; i < n.length; i++){ n[i] = arguments[i]; } return e.apply(r, n); }; }; }), 5327: (function(t, e, r) { "use strict"; var n = r(4867); function i(t) { return encodeURIComponent(t).replace(/%3A/gi, ':').replace(/%24/g, '$').replace(/%2C/gi, ',').replace(/%20/g, '+').replace(/%5B/gi, '[').replace(/%5D/gi, ']'); } t.exports = function t(e, r, o) { if (!r) { return e; } var s; if (o) { s = o(r); } else if (n.isURLSearchParams(r)) { s = r.toString(); } else { var a = []; n.forEach(r, function t(e, r) { if (e === null || typeof e === 'undefined') { return; } if (n.isArray(e)) { r = r + '[]'; } else { e = [ e ]; } n.forEach(e, function t(e) { if (n.isDate(e)) { e = e.toISOString(); } else if (n.isObject(e)) { e = JSON.stringify(e); } a.push(i(r) + '=' + i(e)); }); }); s = a.join('&'); } if (s) { var f = e.indexOf('#'); if (f !== -1) { e = e.slice(0, f); } e += (e.indexOf('?') === -1 ? '?' : '&') + s; } return e; }; }), 7303: (function(t) { "use strict"; t.exports = function t(e, r) { return r ? e.replace(/\/+$/, '') + '/' + r.replace(/^\/+/, '') : e; }; }), 4372: (function(t, e, r) { "use strict"; var n = r(4867); t.exports = (n.isStandardBrowserEnv() ? (function t() { return { write: function t(e, r, i, o, s, a) { var f = []; f.push(e + '=' + encodeURIComponent(r)); if (n.isNumber(i)) { f.push('expires=' + new Date(i).toGMTString()); } if (n.isString(o)) { f.push('path=' + o); } if (n.isString(s)) { f.push('domain=' + s); } if (a === true) { f.push('secure'); } document.cookie = f.join('; '); }, read: function t(e) { var r = document.cookie.match(new RegExp('(^|;\\s*)(' + e + ')=([^;]*)')); return (r ? decodeURIComponent(r[3]) : null); }, remove: function t(e) { this.write(e, '', Date.now() - 86400000); } }; })() : (function t() { return { write: function t() {}, read: function t() { return null; }, remove: function t() {} }; })()); }), 1793: (function(t) { "use strict"; t.exports = function t(e) { return /^([a-z][a-z\d+\-.]*:)?\/\//i.test(e); }; }), 6268: (function(t, e, r) { "use strict"; var n = r(4867); t.exports = function t(e) { return n.isObject(e) && (e.isAxiosError === true); }; }), 7985: (function(t, e, r) { "use strict"; var n = r(4867); t.exports = (n.isStandardBrowserEnv() ? (function t() { var e = /(msie|trident)/i.test(navigator.userAgent); var r = document.createElement('a'); var i; function o(t) { var n = t; if (e) { r.setAttribute('href', n); n = r.href; } r.setAttribute('href', n); return { href: r.href, protocol: r.protocol ? r.protocol.replace(/:$/, '') : '', host: r.host, search: r.search ? r.search.replace(/^\?/, '') : '', hash: r.hash ? r.hash.replace(/^#/, '') : '', hostname: r.hostname, port: r.port, pathname: (r.pathname.charAt(0) === '/') ? r.pathname : '/' + r.pathname }; } i = o(window.location.href); return function t(e) { var r = (n.isString(e)) ? o(e) : e; return (r.protocol === i.protocol && r.host === i.host); }; })() : (function t() { return function t() { return true; }; })()); }), 6016: (function(t, e, r) { "use strict"; var n = r(4867); t.exports = function t(e, r) { n.forEach(e, function t(n, i) { if (i !== r && i.toUpperCase() === r.toUpperCase()) { e[r] = n; delete e[i]; } }); }; }), 1623: (function(t) { t.exports = null; }), 4109: (function(t, e, r) { "use strict"; var n = r(4867); var i = [ 'age', 'authorization', 'content-length', 'content-type', 'etag', 'expires', 'from', 'host', 'if-modified-since', 'if-unmodified-since', 'last-modified', 'location', 'max-forwards', 'proxy-authorization', 'referer', 'retry-after', 'user-agent' ]; t.exports = function t(e) { var r = {}; var o; var s; var a; if (!e) { return r; } n.forEach(e.split('\n'), function t(e) { a = e.indexOf(':'); o = n.trim(e.substr(0, a)).toLowerCase(); s = n.trim(e.substr(a + 1)); if (o) { if (r[o] && i.indexOf(o) >= 0) { return; } if (o === 'set-cookie') { r[o] = (r[o] ? r[o] : []).concat([ s ]); } else { r[o] = r[o] ? r[o] + ', ' + s : s; } } }); return r; }; }), 205: (function(t) { "use strict"; t.exports = function t(e) { var r = /^([-+\w]{1,25})(:?\/\/|:)/.exec(e); return r && r[1] || ''; }; }), 8713: (function(t) { "use strict"; t.exports = function t(e) { return function t(r) { return e.apply(null, r); }; }; }), 7675: (function(t, e, r) { "use strict"; var n = r(8764)["Buffer"]; var i = r(4867); function o(t, e) { e = e || new FormData(); var r = []; function o(t) { if (t === null) return ''; if (i.isDate(t)) { return t.toISOString(); } if (i.isArrayBuffer(t) || i.isTypedArray(t)) { return typeof Blob === 'function' ? new Blob([ t ]) : n.from(t); } return t; } function s(t, n) { if (i.isPlainObject(t) || i.isArray(t)) { if (r.indexOf(t) !== -1) { throw Error('Circular reference detected in ' + n); } r.push(t); i.forEach(t, function t(r, a) { if (i.isUndefined(r)) return; var f = n ? n + '.' + a : a; var u; if (r && !n && typeof r === 'object') { if (i.endsWith(a, '{}')) { r = JSON.stringify(r); } else if (i.endsWith(a, '[]') && (u = i.toArray(r))) { u.forEach(function(t) { !i.isUndefined(t) && e.append(f, o(t)); }); return; } } s(r, f); }); r.pop(); } else { e.append(n, o(t)); } } s(t); return e; } t.exports = o; }), 4875: (function(t, e, r) { "use strict"; var n = (r(7288).version); var i = r(723); var o = {}; [ 'object', 'boolean', 'number', 'function', 'string', 'symbol' ].forEach(function(t, e) { o[t] = function r(n) { return typeof n === t || 'a' + (e < 1 ? 'n ' : ' ') + t; }; }); var s = {}; o.transitional = function t(e, r, o) { function a(t, e) { return '[Axios v' + n + '] Transitional option \'' + t + '\'' + e + (o ? '. ' + o : ''); } return function(t, n, o) { if (e === false) { throw new i(a(n, ' has been removed' + (r ? ' in ' + r : '')), i.ERR_DEPRECATED); } if (r && !s[n]) { s[n] = true; console.warn(a(n, ' has been deprecated since v' + r + ' and will be removed in the near future')); } return e ? e(t, n, o) : true; }; }; function a(t, e, r) { if (typeof t !== 'object') { throw new i('options must be an object', i.ERR_BAD_OPTION_VALUE); } var n = Object.keys(t); var o = n.length; while(o-- > 0){ var s = n[o]; var a = e[s]; if (a) { var f = t[s]; var u = f === undefined || a(f, s, t); if (u !== true) { throw new i('option ' + s + ' must be ' + u, i.ERR_BAD_OPTION_VALUE); } continue; } if (r !== true) { throw new i('Unknown option ' + s, i.ERR_BAD_OPTION); } } } t.exports = { assertOptions: a, validators: o }; }), 4867: (function(t, e, r) { "use strict"; var n = r(1849); var i = Object.prototype.toString; var o = (function(t) { return function(e) { var r = i.call(e); return t[r] || (t[r] = r.slice(8, -1).toLowerCase()); }; })(Object.create(null)); function s(t) { t = t.toLowerCase(); return function e(r) { return o(r) === t; }; } function a(t) { return Array.isArray(t); } function f(t) { return typeof t === 'undefined'; } function u(t) { return t !== null && !f(t) && t.constructor !== null && !f(t.constructor) && typeof t.constructor.isBuffer === 'function' && t.constructor.isBuffer(t); } var c = s('ArrayBuffer'); function l(t) { var e; if ((typeof ArrayBuffer !== 'undefined') && (ArrayBuffer.isView)) { e = ArrayBuffer.isView(t); } else { e = (t) && (t.buffer) && (c(t.buffer)); } return e; } function h(t) { return typeof t === 'string'; } function d(t) { return typeof t === 'number'; } function p(t) { return t !== null && typeof t === 'object'; } function g(t) { if (o(t) !== 'object') { return false; } var e = Object.getPrototypeOf(t); return e === null || e === Object.prototype; } var b = s('Date'); var v = s('File'); var y = s('Blob'); var m = s('FileList'); function w(t) { return i.call(t) === '[object Function]'; } function _(t) { return p(t) && w(t.pipe); } function S(t) { var e = '[object FormData]'; return t && ((typeof FormData === 'function' && t instanceof FormData) || i.call(t) === e || (w(t.toString) && t.toString() === e)); } var E = s('URLSearchParams'); function x(t) { return t.trim ? t.trim() : t.replace(/^\s+|\s+$/g, ''); } function M() { if (typeof navigator !== 'undefined' && (navigator.product === 'ReactNative' || navigator.product === 'NativeScript' || navigator.product === 'NS')) { return false; } return (typeof window !== 'undefined' && typeof document !== 'undefined'); } function T(t, e) { if (t === null || typeof t === 'undefined') { return; } if (typeof t !== 'object') { t = [ t ]; } if (a(t)) { for(var r = 0, n = t.length; r < n; r++){ e.call(null, t[r], r, t); } } else { for(var i in t){ if (Object.prototype.hasOwnProperty.call(t, i)) { e.call(null, t[i], i, t); } } } } function A() { var t = {}; function e(e, r) { if (g(t[r]) && g(e)) { t[r] = A(t[r], e); } else if (g(e)) { t[r] = A({}, e); } else if (a(e)) { t[r] = e.slice(); } else { t[r] = e; } } for(var r = 0, n = arguments.length; r < n; r++){ T(arguments[r], e); } return t; } function O(t, e, r) { T(e, function e(i, o) { if (r && typeof i === 'function') { t[o] = n(i, r); } else { t[o] = i; } }); return t; } function k(t) { if (t.charCodeAt(0) === 0xFEFF) { t = t.slice(1); } return t; } function I(t, e, r, n) { t.prototype = Object.create(e.prototype, n); t.prototype.constructor = t; r && Object.assign(t.prototype, r); } function R(t, e, r) { var n; var i; var o; var s = {}; e = e || {}; do { n = Object.getOwnPropertyNames(t); i = n.length; while(i-- > 0){ o = n[i]; if (!s[o]) { e[o] = t[o]; s[o] = true; } } t = Object.getPrototypeOf(t); }while (t && (!r || r(t, e)) && t !== Object.prototype) return e; } function N(t, e, r) { t = String(t); if (r === undefined || r > t.length) { r = t.length; } r -= e.length; var n = t.indexOf(e, r); return n !== -1 && n === r; } function j(t) { if (!t) return null; var e = t.length; if (f(e)) return null; var r = new Array(e); while(e-- > 0){ r[e] = t[e]; } return r; } var P = (function(t) { return function(e) { return t && e instanceof t; }; })(typeof Uint8Array !== 'undefined' && Object.getPrototypeOf(Uint8Array)); t.exports = { isArray: a, isArrayBuffer: c, isBuffer: u, isFormData: S, isArrayBufferView: l, isString: h, isNumber: d, isObject: p, isPlainObject: g, isUndefined: f, isDate: b, isFile: v, isBlob: y, isFunction: w, isStream: _, isURLSearchParams: E, isStandardBrowserEnv: M, forEach: T, merge: A, extend: O, trim: x, stripBOM: k, inherits: I, toFlatObject: R, kindOf: o, kindOfTest: s, endsWith: N, toArray: j, isTypedArray: P, isFileList: m }; }), 9742: (function(t, e) { "use strict"; e.byteLength = u; e.toByteArray = l; e.fromByteArray = p; var r = []; var n = []; var i = typeof Uint8Array !== 'undefined' ? Uint8Array : Array; var o = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/'; for(var s = 0, a = o.length; s < a; ++s){ r[s] = o[s]; n[o.charCodeAt(s)] = s; } n['-'.charCodeAt(0)] = 62; n['_'.charCodeAt(0)] = 63; function f(t) { var e = t.length; if (e % 4 > 0) { throw new Error('Invalid string. Length must be a multiple of 4'); } var r = t.indexOf('='); if (r === -1) r = e; var n = r === e ? 0 : 4 - (r % 4); return [ r, n ]; } function u(t) { var e = f(t); var r = e[0]; var n = e[1]; return ((r + n) * 3 / 4) - n; } function c(t, e, r) { return ((e + r) * 3 / 4) - r; } function l(t) { var e; var r = f(t); var o = r[0]; var s = r[1]; var a = new i(c(t, o, s)); var u = 0; var l = s > 0 ? o - 4 : o; var h; for(h = 0; h < l; h += 4){ e = (n[t.charCodeAt(h)] << 18) | (n[t.charCodeAt(h + 1)] << 12) | (n[t.charCodeAt(h + 2)] << 6) | n[t.charCodeAt(h + 3)]; a[u++] = (e >> 16) & 0xFF; a[u++] = (e >> 8) & 0xFF; a[u++] = e & 0xFF; } if (s === 2) { e = (n[t.charCodeAt(h)] << 2) | (n[t.charCodeAt(h + 1)] >> 4); a[u++] = e & 0xFF; } if (s === 1) { e = (n[t.charCodeAt(h)] << 10) | (n[t.charCodeAt(h + 1)] << 4) | (n[t.charCodeAt(h + 2)] >> 2); a[u++] = (e >> 8) & 0xFF; a[u++] = e & 0xFF; } return a; } function h(t) { return r[t >> 18 & 0x3F] + r[t >> 12 & 0x3F] + r[t >> 6 & 0x3F] + r[t & 0x3F]; } function d(t, e, r) { var n; var i = []; for(var o = e; o < r; o += 3){ n = ((t[o] << 16) & 0xFF0000) + ((t[o + 1] << 8) & 0xFF00) + (t[o + 2] & 0xFF); i.push(h(n)); } return i.join(''); } function p(t) { var e; var n = t.length; var i = n % 3; var o = []; var s = 16383; for(var a = 0, f = n - i; a < f; a += s){ o.push(d(t, a, (a + s) > f ? f : (a + s))); } if (i === 1) { e = t[n - 1]; o.push(r[e >> 2] + r[(e << 4) & 0x3F] + '=='); } else if (i === 2) { e = (t[n - 2] << 8) + t[n - 1]; o.push(r[e >> 10] + r[(e >> 4) & 0x3F] + r[(e << 2) & 0x3F] + '='); } return o.join(''); } }), 4431: (function(t, e, r) { var n; ; (function(i) { 'use strict'; var o, s = /^-?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?$/i, a = Math.ceil, f = Math.floor, u = '[BigNumber Error] ', c = u + 'Number primitive has more than 15 significant digits: ', l = 1e14, h = 14, d = 0x1fffffffffffff, p = [ 1, 10, 100, 1e3, 1e4, 1e5, 1e6, 1e7, 1e8, 1e9, 1e10, 1e11, 1e12, 1e13 ], g = 1e7, b = 1E9; function v(t) { var e, r, n, i = L.prototype = { constructor: L, toString: null, valueOf: null }, o = new L(1), M = 20, T = 4, A = -7, O = 21, k = -1e7, I = 1e7, R = false, N = 1, j = 0, P = { prefix: '', groupSize: 3, secondaryGroupSize: 0, groupSeparator: ',', decimalSeparator: '.', fractionGroupSize: 0, fractionGroupSeparator: '\xA0', suffix: '' }, C = '0123456789abcdefghijklmnopqrstuvwxyz', B = true; function L(t, e) { var i, o, a, u, l, p, g, b, v = this; if (!(v instanceof L)) return new L(t, e); if (e == null) { if (t && t._isBigNumber === true) { v.s = t.s; if (!t.c || t.e > I) { v.c = v.e = null; } else if (t.e < k) { v.c = [ v.e = 0 ]; } else { v.e = t.e; v.c = t.c.slice(); } return; } if ((p = typeof t == 'number') && t * 0 == 0) { v.s = 1 / t < 0 ? (t = -t, -1) : 1; if (t === ~~t) { for(u = 0, l = t; l >= 10; l /= 10, u++); if (u > I) { v.c = v.e = null; } else { v.e = u; v.c = [ t ]; } return; } b = String(t); } else { if (!s.test(b = String(t))) return n(v, b, p); v.s = b.charCodeAt(0) == 45 ? (b = b.slice(1), -1) : 1; } if ((u = b.indexOf('.')) > -1) b = b.replace('.', ''); if ((l = b.search(/e/i)) > 0) { if (u < 0) u = l; u += +b.slice(l + 1); b = b.substring(0, l); } else if (u < 0) { u = b.length; } } else { _(e, 2, C.length, 'Base'); if (e == 10 && B) { v = new L(t); return F(v, M + v.e + 1, T); } b = String(t); if (p = typeof t == 'number') { if (t * 0 != 0) return n(v, b, p, e); v.s = 1 / t < 0 ? (b = b.slice(1), -1) : 1; if (L.DEBUG && b.replace(/^0\.0*|\./, '').length > 15) { throw Error(c + t); } } else { v.s = b.charCodeAt(0) === 45 ? (b = b.slice(1), -1) : 1; } i = C.slice(0, e); u = l = 0; for(g = b.length; l < g; l++){ if (i.indexOf(o = b.charAt(l)) < 0) { if (o == '.') { if (l > u) { u = g; continue; } } else if (!a) { if (b == b.toUpperCase() && (b = b.toLowerCase()) || b == b.toLowerCase() && (b = b.toUpperCase())) { a = true; l = -1; u = 0; continue; } } return n(v, String(t), p, e); } } p = false; b = r(b, e, 10, v.s); if ((u = b.indexOf('.')) > -1) b = b.replace('.', ''); else u = b.length; } for(l = 0; b.charCodeAt(l) === 48; l++); for(g = b.length; b.charCodeAt(--g) === 48;); if (b = b.slice(l, ++g)) { g -= l; if (p && L.DEBUG && g > 15 && (t > d || t !== f(t))) { throw Error(c + (v.s * t)); } if ((u = u - l - 1) > I) { v.c = v.e = null; } else if (u < k) { v.c = [ v.e = 0 ]; } else { v.e = u; v.c = []; l = (u + 1) % h; if (u < 0) l += h; if (l < g) { if (l) v.c.push(+b.slice(0, l)); for(g -= h; l < g;){ v.c.push(+b.slice(l, l += h)); } l = h - (b = b.slice(l)).length; } else { l -= g; } for(; l--; b += '0'); v.c.push(+b); } } else { v.c = [ v.e = 0 ]; } } L.clone = v; L.ROUND_UP = 0; L.ROUND_DOWN = 1; L.ROUND_CEIL = 2; L.ROUND_FLOOR = 3; L.ROUND_HALF_UP = 4; L.ROUND_HALF_DOWN = 5; L.ROUND_HALF_EVEN = 6; L.ROUND_HALF_CEIL = 7; L.ROUND_HALF_FLOOR = 8; L.EUCLID = 9; L.config = L.set = function(t) { var e, r; if (t != null) { if (typeof t == 'object') { if (t.hasOwnProperty(e = 'DECIMAL_PLACES')) { r = t[e]; _(r, 0, b, e); M = r; } if (t.hasOwnProperty(e = 'ROUNDING_MODE')) { r = t[e]; _(r, 0, 8, e); T = r; } if (t.hasOwnProperty(e = 'EXPONENTIAL_AT')) { r = t[e]; if (r && r.pop) { _(r[0], -b, 0, e); _(r[1], 0, b, e); A = r[0]; O = r[1]; } else { _(r, -b, b, e); A = -(O = r < 0 ? -r : r); } } if (t.hasOwnProperty(e = 'RANGE')) { r = t[e]; if (r && r.pop) { _(r[0], -b, -1, e); _(r[1], 1, b, e); k = r[0]; I = r[1]; } else { _(r, -b, b, e); if (r) { k = -(I = r < 0 ? -r : r); } else { throw Error(u + e + ' cannot be zero: ' + r); } } } if (t.hasOwnProperty(e = 'CRYPTO')) { r = t[e]; if (r === !!r) { if (r) { if (typeof crypto != 'undefined' && crypto && (crypto.getRandomValues || crypto.randomBytes)) { R = r; } else { R = !r; throw Error(u + 'crypto unavailable'); } } else { R = r; } } else { throw Error(u + e + ' not true or false: ' + r); } } if (t.hasOwnProperty(e = 'MODULO_MODE')) { r = t[e]; _(r, 0, 9, e); N = r; } if (t.hasOwnProperty(e = 'POW_PRECISION')) { r = t[e]; _(r, 0, b, e); j = r; } if (t.hasOwnProperty(e = 'FORMAT')) { r = t[e]; if (typeof r == 'object') P = r; else throw Error(u + e + ' not an object: ' + r); } if (t.hasOwnProperty(e = 'ALPHABET')) { r = t[e]; if (typeof r == 'string' && !/^.?$|[+\-.\s]|(.).*\1/.test(r)) { B = r.slice(0, 10) == '0123456789'; C = r; } else { throw Error(u + e + ' invalid: ' + r); } } } else { throw Error(u + 'Object expected: ' + t); } } return { DECIMAL_PLACES: M, ROUNDING_MODE: T, EXPONENTIAL_AT: [ A, O ], RANGE: [ k, I ], CRYPTO: R, MODULO_MODE: N, POW_PRECISION: j, FORMAT: P, ALPHABET: C }; }; L.isBigNumber = function(t) { if (!t || t._isBigNumber !== true) return false; if (!L.DEBUG) return true; var e, r, n = t.c, i = t.e, o = t.s; t: if ({}.toString.call(n) == '[object Array]') { if ((o === 1 || o === -1) && i >= -b && i <= b && i === f(i)) { if (n[0] === 0) { if (i === 0 && n.length === 1) return true; break t; } e = (i + 1) % h; if (e < 1) e += h; if (String(n[0]).length == e) { for(e = 0; e < n.length; e++){ r = n[e]; if (r < 0 || r >= l || r !== f(r)) break t; } if (r !== 0) return true; } } } else if (n === null && i === null && (o === null || o === 1 || o === -1)) { return true; } throw Error(u + 'Invalid BigNumber: ' + t); }; L.maximum = L.max = function() { return D(arguments, i.lt); }; L.minimum = L.min = function() { return D(arguments, i.gt); }; L.random = (function() { var t = 0x20000000000000; var e = (Math.random() * t) & 0x1fffff ? function() { return f(Math.random() * t); } : function() { return ((Math.random() * 0x40000000 | 0) * 0x800000) + (Math.random() * 0x800000 | 0); }; return function(t) { var r, n, i, s, c, l = 0, d = [], g = new L(o); if (t == null) t = M; else _(t, 0, b); s = a(t / h); if (R) { if (crypto.getRandomValues) { r = crypto.getRandomValues(new Uint32Array(s *= 2)); for(; l < s;){ c = r[l] * 0x20000 + (r[l + 1] >>> 11); if (c >= 9e15) { n = crypto.getRandomValues(new Uint32Array(2)); r[l] = n[0]; r[l + 1] = n[1]; } else { d.push(c % 1e14); l += 2; } } l = s / 2; } else if (crypto.randomBytes) { r = crypto.randomBytes(s *= 7); for(; l < s;){ c = ((r[l] & 31) * 0x1000000000000) + (r[l + 1] * 0x10000000000) + (r[l + 2] * 0x100000000) + (r[l + 3] * 0x1000000) + (r[l + 4] << 16) + (r[l + 5] << 8) + r[l + 6]; if (c >= 9e15) { crypto.randomBytes(7).copy(r, l); } else { d.push(c % 1e14); l += 7; } } l = s / 7; } else { R = false; throw Error(u + 'crypto unavailable'); } } if (!R) { for(; l < s;){ c = e(); if (c < 9e15) d[l++] = c % 1e14; } } s = d[--l]; t %= h; if (s && t) { c = p[h - t]; d[l] = f(s / c) * c; } for(; d[l] === 0; d.pop(), l--); if (l < 0) { d = [ i = 0 ]; } else { for(i = -1; d[0] === 0; d.splice(0, 1), i -= h); for(l = 1, c = d[0]; c >= 10; c /= 10, l++); if (l < h) i -= h - l; } g.e = i; g.c = d; return g; }; })(); L.sum = function() { var t = 1, e = arguments, r = new L(e[0]); for(; t < e.length;)r = r.plus(e[t++]); return r; }; r = (function() { var t = '0123456789'; function r(t, e, r, n) { var i, o = [ 0 ], s, a = 0, f = t.length; for(; a < f;){ for(s = o.length; s--; o[s] *= e); o[0] += n.indexOf(t.charAt(a++)); for(i = 0; i < o.length; i++){ if (o[i] > r - 1) { if (o[i + 1] == null) o[i + 1] = 0; o[i + 1] += o[i] / r | 0; o[i] %= r; } } } return o.reverse(); } return function(n, i, o, s, a) { var f, u, c, l, h, d, p, g, b = n.indexOf('.'), v = M, y = T; if (b >= 0) { l = j; j = 0; n = n.replace('.', ''); g = new L(i); d = g.pow(n.length - b); j = l; g.c = r(x(m(d.c), d.e, '0'), 10, o, t); g.e = g.c.length; } p = r(n, i, o, a ? (f = C, t) : (f = t, C)); c = l = p.length; for(; p[--l] == 0; p.pop()); if (!p[0]) return f.charAt(0); if (b < 0) { --c; } else { d.c = p; d.e = c; d.s = s; d = e(d, g, v, y, o); p = d.c; h = d.r; c = d.e; } u = c + v + 1; b = p[u]; l = o / 2; h = h || u < 0 || p[u + 1] != null; h = y < 4 ? (b != null || h) && (y == 0 || y == (d.s < 0 ? 3 : 2)) : b > l || b == l && (y == 4 || h || y == 6 && p[u - 1] & 1 || y == (d.s < 0 ? 8 : 7)); if (u < 1 || !p[0]) { n = h ? x(f.charAt(1), -v, f.charAt(0)) : f.charAt(0); } else { p.length = u; if (h) { for(--o; ++p[--u] > o;){ p[u] = 0; if (!u) { ++c; p = [ 1 ].concat(p); } } } for(l = p.length; !p[--l];); for(b = 0, n = ''; b <= l; n += f.charAt(p[b++])); n = x(n, c, f.charAt(0)); } return n; }; })(); e = (function() { function t(t, e, r) { var n, i, o, s, a = 0, f = t.length, u = e % g, c = e / g | 0; for(t = t.slice(); f--;){ o = t[f] % g; s = t[f] / g | 0; n = c * o + s * u; i = u * o + ((n % g) * g) + a; a = (i / r | 0) + (n / g | 0) + c * s; t[f] = i % r; } if (a) t = [ a ].concat(t); return t; } function e(t, e, r, n) { var i, o; if (r != n) { o = r > n ? 1 : -1; } else { for(i = o = 0; i < r; i++){ if (t[i] != e[i]) { o = t[i] > e[i] ? 1 : -1; break; } } } return o; } function r(t, e, r, n) { var i = 0; for(; r--;){ t[r] -= i; i = t[r] < e[r] ? 1 : 0; t[r] = i * n + t[r] - e[r]; } for(; !t[0] && t.length > 1; t.splice(0, 1)); } return function(n, i, o, s, a) { var u, c, d, p, g, b, v, m, w, _, S, E, x, M, T, A, O, k = n.s == i.s ? 1 : -1, I = n.c, R = i.c; if (!I || !I[0] || !R || !R[0]) { return new L(!n.s || !i.s || (I ? R && I[0] == R[0] : !R) ? NaN : I && I[0] == 0 || !R ? k * 0 : k / 0); } m = new L(k); w = m.c = []; c = n.e - i.e; k = o + c + 1; if (!a) { a = l; c = y(n.e / h) - y(i.e / h); k = k / h | 0; } for(d = 0; R[d] == (I[d] || 0); d++); if (R[d] > (I[d] || 0)) c--; if (k < 0) { w.push(1); p = true; } else { M = I.length; A = R.length; d = 0; k += 2; g = f(a / (R[0] + 1)); if (g > 1) { R = t(R, g, a); I = t(I, g, a); A = R.length; M = I.length; } x = A; _ = I.slice(0, A); S = _.length; for(; S < A; _[S++] = 0); O = R.slice(); O = [ 0 ].concat(O); T = R[0]; if (R[1] >= a / 2) T++; do { g = 0; u = e(R, _, A, S); if (u < 0) { E = _[0]; if (A != S) E = E * a + (_[1] || 0); g = f(E / T); if (g > 1) { if (g >= a) g = a - 1; b = t(R, g, a); v = b.length; S = _.length; while(e(b, _, v, S) == 1){ g--; r(b, A < v ? O : R, v, a); v = b.length; u = 1; } } else { if (g == 0) { u = g = 1; } b = R.slice(); v = b.length; } if (v < S) b = [ 0 ].concat(b); r(_, b, S, a); S = _.length; if (u == -1) { while(e(R, _, A, S) < 1){ g++; r(_, A < S ? O : R, S, a); S = _.length; } } } else if (u === 0) { g++; _ = [ 0 ]; } w[d++] = g; if (_[0]) { _[S++] = I[x] || 0; } else { _ = [ I[x] ]; S = 1; } }while ((x++ < M || _[0] != null) && k--) p = _[0] != null; if (!w[0]) w.splice(0, 1); } if (a == l) { for(d = 1, k = w[0]; k >= 10; k /= 10, d++); F(m, o + (m.e = d + c * h - 1) + 1, s, p); } else { m.e = c; m.r = +p; } return m; }; })(); function U(t, e, r, n) { var i, o, s, a, f; if (r == null) r = T; else _(r, 0, 8); if (!t.c) return t.toString(); i = t.c[0]; s = t.e; if (e == null) { f = m(t.c); f = n == 1 || n == 2 && (s <= A || s >= O) ? E(f, s) : x(f, s, '0'); } else { t = F(new L(t), e, r); o = t.e; f = m(t.c); a = f.length; if (n == 1 || n == 2 && (e <= o || o <= A)) { for(; a < e; f += '0', a++); f = E(f, o); } else { e -= s; f = x(f, o, '0'); if (o + 1 > a) { if (--e > 0) for(f += '.'; e--; f += '0'); } else { e += o - a; if (e > 0) { if (o + 1 == a) f += '.'; for(; e--; f += '0'); } } } } return t.s < 0 && i ? '-' + f : f; } function D(t, e) { var r, n = 1, i = new L(t[0]); for(; n < t.length; n++){ r = new L(t[n]); if (!r.s) { i = r; break; } else if (e.call(i, r)) { i = r; } } return i; } function $(t, e, r) { var n = 1, i = e.length; for(; !e[--i]; e.pop()); for(i = e[0]; i >= 10; i /= 10, n++); if ((r = n + r * h - 1) > I) { t.c = t.e = null; } else if (r < k) { t.c = [ t.e = 0 ]; } else { t.e = r; t.c = e; } return t; } n = (function() { var t = /^(-?)0([xbo])(?=\w[\w.]*$)/i, e = /^([^.]+)\.$/, r = /^\.([^.]+)$/, n = /^-?(Infinity|NaN)$/, i = /^\s*\+(?=[\w.])|^\s+|\s+$/g; return function(o, s, a, f) { var c, l = a ? s : s.replace(i, ''); if (n.test(l)) { o.s = isNaN(l) ? null : l < 0 ? -1 : 1; } else { if (!a) { l = l.replace(t, function(t, e, r) { c = (r = r.toLowerCase()) == 'x' ? 16 : r == 'b' ? 2 : 8; return !f || f == c ? e : t; }); if (f) { c = f; l = l.replace(e, '$1').replace(r, '0.$1'); } if (s != l) return new L(l, c); } if (L.DEBUG) { throw Error(u + 'Not a' + (f ? ' base ' + f : '') + ' number: ' + s); } o.s = null; } o.c = o.e = null; }; })(); function F(t, e, r, n) { var i, o, s, u, c, d, g, b = t.c, v = p; if (b) { t: { for(i = 1, u = b[0]; u >= 10; u /= 10, i++); o = e - i; if (o < 0) { o += h; s = e; c = b[d = 0]; g = c / v[i - s - 1] % 10 | 0; } else { d = a((o + 1) / h); if (d >= b.length) { if (n) { for(; b.length <= d; b.push(0)); c = g = 0; i = 1; o %= h; s = o - h + 1; } else { break t; } } else { c = u = b[d]; for(i = 1; u >= 10; u /= 10, i++); o %= h; s = o - h + i; g = s < 0 ? 0 : c / v[i - s - 1] % 10 | 0; } } n = n || e < 0 || b[d + 1] != null || (s < 0 ? c : c % v[i - s - 1]); n = r < 4 ? (g || n) && (r == 0 || r == (t.s < 0 ? 3 : 2)) : g > 5 || g == 5 && (r == 4 || n || r == 6 && ((o > 0 ? s > 0 ? c / v[i - s] : 0 : b[d - 1]) % 10) & 1 || r == (t.s < 0 ? 8 : 7)); if (e < 1 || !b[0]) { b.length = 0; if (n) { e -= t.e + 1; b[0] = v[(h - e % h) % h]; t.e = -e || 0; } else { b[0] = t.e = 0; } return t; } if (o == 0) { b.length = d; u = 1; d--; } else { b.length = d + 1; u = v[h - o]; b[d] = s > 0 ? f(c / v[i - s] % v[s]) * u : 0; } if (n) { for(;;){ if (d == 0) { for(o = 1, s = b[0]; s >= 10; s /= 10, o++); s = b[0] += u; for(u = 1; s >= 10; s /= 10, u++); if (o != u) { t.e++; if (b[0] == l) b[0] = 1; } break; } else { b[d] += u; if (b[d] != l) break; b[d--] = 0; u = 1; } } } for(o = b.length; b[--o] === 0; b.pop()); } if (t.e > I) { t.c = t.e = null; } else if (t.e < k) { t.c = [ t.e = 0 ]; } } return t; } function W(t) { var e, r = t.e; if (r === null) return t.toString(); e = m(t.c); e = r <= A || r >= O ? E(e, r) : x(e, r, '0'); return t.s < 0 ? '-' + e : e; } i.absoluteValue = i.abs = function() { var t = new L(this); if (t.s < 0) t.s = 1; return t; }; i.comparedTo = function(t, e) { return w(this, new L(t, e)); }; i.decimalPlaces = i.dp = function(t, e) { var r, n, i, o = this; if (t != null) { _(t, 0, b); if (e == null) e = T; else _(e, 0, 8); return F(new L(o), t + o.e + 1, e); } if (!(r = o.c)) return null; n = ((i = r.length - 1) - y(this.e / h)) * h; if (i = r[i]) for(; i % 10 == 0; i /= 10, n--); if (n < 0) n = 0; return n; }; i.dividedBy = i.div = function(t, r) { return e(this, new L(t, r), M, T); }; i.dividedToIntegerBy = i.idiv = function(t, r) { return e(this, new L(t, r), 0, 1); }; i.exponentiatedBy = i.pow = function(t, e) { var r, n, i, s, c, l, d, p, g, b = this; t = new L(t); if (t.c && !t.isInteger()) { throw Error(u + 'Exponent not an integer: ' + W(t)); } if (e != null) e = new L(e); l = t.e > 14; if (!b.c || !b.c[0] || b.c[0] == 1 && !b.e && b.c.length == 1 || !t.c || !t.c[0]) { g = new L(Math.pow(+W(b), l ? 2 - S(t) : +W(t))); return e ? g.mod(e) : g; } d = t.s < 0; if (e) { if (e.c ? !e.c[0] : !e.s) return new L(NaN); n = !d && b.isInteger() && e.isInteger(); if (n) b = b.mod(e); } else if (t.e > 9 && (b.e > 0 || b.e < -1 || (b.e == 0 ? b.c[0] > 1 || l && b.c[1] >= 24e7 : b.c[0] < 8e13 || l && b.c[0] <= 9999975e7))) { s = b.s < 0 && S(t) ? -0 : 0; if (b.e > -1) s = 1 / s; return new L(d ? 1 / s : s); } else if (j) { s = a(j / h + 2); } if (l) { r = new L(0.5); if (d) t.s = 1; p = S(t); } else { i = Math.abs(+W(t)); p = i % 2; } g = new L(o); for(;;){ if (p) { g = g.times(b); if (!g.c) break; if (s) { if (g.c.length > s) g.c.length = s; } else if (n) { g = g.mod(e); } } if (i) { i = f(i / 2); if (i === 0) break; p = i % 2; } else { t = t.times(r); F(t, t.e + 1, 1); if (t.e > 14) { p = S(t); } else { i = +W(t); if (i === 0) break; p = i % 2; } } b = b.times(b); if (s) { if (b.c && b.c.length > s) b.c.length = s; } else if (n) { b = b.mod(e); } } if (n) return g; if (d) g = o.div(g); return e ? g.mod(e) : s ? F(g, j, T, c) : g; }; i.integerValue = function(t) { var e = new L(this); if (t == null) t = T; else _(t, 0, 8); return F(e, e.e + 1, t); }; i.isEqualTo = i.eq = function(t, e) { return w(this, new L(t, e)) === 0; }; i.isFinite = function() { return !!this.c; }; i.isGreaterThan = i.gt = function(t, e) { return w(this, new L(t, e)) > 0; }; i.isGreaterThanOrEqualTo = i.gte = function(t, e) { return (e = w(this, new L(t, e))) === 1 || e === 0; }; i.isInteger = function() { return !!this.c && y(this.e / h) > this.c.length - 2; }; i.isLessThan = i.lt = function(t, e) { return w(this, new L(t, e)) < 0; }; i.isLessThanOrEqualTo = i.lte = function(t, e) { return (e = w(this, new L(t, e))) === -1 || e === 0; }; i.isNaN = function() { return !this.s; }; i.isNegative = function() { return this.s < 0; }; i.isPositive = function() { return this.s > 0; }; i.isZero = function() { return !!this.c && this.c[0] == 0; }; i.minus = function(t, e) { var r, n, i, o, s = this, a = s.s; t = new L(t, e); e = t.s; if (!a || !e) return new L(NaN); if (a != e) { t.s = -e; return s.plus(t); } var f = s.e / h, u = t.e / h, c = s.c, d = t.c; if (!f || !u) { if (!c || !d) return c ? (t.s = -e, t) : new L(d ? s : NaN); if (!c[0] || !d[0]) { return d[0] ? (t.s = -e, t) : new L(c[0] ? s : T == 3 ? -0 : 0); } } f = y(f); u = y(u); c = c.slice(); if (a = f - u) { if (o = a < 0) { a = -a; i = c; } else { u = f; i = d; } i.reverse(); for(e = a; e--; i.push(0)); i.reverse(); } else { n = (o = (a = c.length) < (e = d.length)) ? a : e; for(a = e = 0; e < n; e++){ if (c[e] != d[e]) { o = c[e] < d[e]; break; } } } if (o) { i = c; c = d; d = i; t.s = -t.s; } e = (n = d.length) - (r = c.length); if (e > 0) for(; e--; c[r++] = 0); e = l - 1; for(; n > a;){ if (c[--n] < d[n]) { for(r = n; r && !c[--r]; c[r] = e); --c[r]; c[n] += l; } c[n] -= d[n]; } for(; c[0] == 0; c.splice(0, 1), --u); if (!c[0]) { t.s = T == 3 ? -1 : 1; t.c = [ t.e = 0 ]; return t; } return $(t, c, u); }; i.modulo = i.mod = function(t, r) { var n, i, o = this; t = new L(t, r); if (!o.c || !t.s || t.c && !t.c[0]) { return new L(NaN); } else if (!t.c || o.c && !o.c[0]) { return new L(o); } if (N == 9) { i = t.s; t.s = 1; n = e(o, t, 0, 3); t.s = i; n.s *= i; } else { n = e(o, t, 0, N); } t = o.minus(n.times(t)); if (!t.c[0] && N == 1) t.s = o.s; return t; }; i.multipliedBy = i.times = function(t, e) { var r, n, i, o, s, a, f, u, c, d, p, b, v, m, w, _ = this, S = _.c, E = (t = new L(t, e)).c; if (!S || !E || !S[0] || !E[0]) { if (!_.s || !t.s || S && !S[0] && !E || E && !E[0] && !S) { t.c = t.e = t.s = null; } else { t.s *= _.s; if (!S || !E) { t.c = t.e = null; } else { t.c = [ 0 ]; t.e = 0; } } return t; } n = y(_.e / h) + y(t.e / h); t.s *= _.s; f = S.length; d = E.length; if (f < d) { v = S; S = E; E = v; i = f; f = d; d = i; } for(i = f + d, v = []; i--; v.push(0)); m = l; w = g; for(i = d; --i >= 0;){ r = 0; p = E[i] % w; b = E[i] / w | 0; for(s = f, o = i + s; o > i;){ u = S[--s] % w; c = S[s] / w | 0; a = b * u + c * p; u = p * u + ((a % w) * w) + v[o] + r; r = (u / m | 0) + (a / w | 0) + b * c; v[o--] = u % m; } v[o] = r; } if (r) { ++n; } else { v.splice(0, 1); } return $(t, v, n); }; i.negated = function() { var t = new L(this); t.s = -t.s || null; return t; }; i.plus = function(t, e) { var r, n = this, i = n.s; t = new L(t, e); e = t.s; if (!i || !e) return new L(NaN); if (i != e) { t.s = -e; return n.minus(t); } var o = n.e / h, s = t.e / h, a = n.c, f = t.c; if (!o || !s) { if (!a || !f) return new L(i / 0); if (!a[0] || !f[0]) return f[0] ? t : new L(a[0] ? n : i * 0); } o = y(o); s = y(s); a = a.slice(); if (i = o - s) { if (i > 0) { s = o; r = f; } else { i = -i; r = a; } r.reverse(); for(; i--; r.push(0)); r.reverse(); } i = a.length; e = f.length; if (i - e < 0) { r = f; f = a; a = r; e = i; } for(i = 0; e;){ i = (a[--e] = a[e] + f[e] + i) / l | 0; a[e] = l === a[e] ? 0 : a[e] % l; } if (i) { a = [ i ].concat(a); ++s; } return $(t, a, s); }; i.precision = i.sd = function(t, e) { var r, n, i, o = this; if (t != null && t !== !!t) { _(t, 1, b); if (e == null) e = T; else _(e, 0, 8); return F(new L(o), t, e); } if (!(r = o.c)) return null; i = r.length - 1; n = i * h + 1; if (i = r[i]) { for(; i % 10 == 0; i /= 10, n--); for(i = r[0]; i >= 10; i /= 10, n++); } if (t && o.e + 1 > n) n = o.e + 1; return n; }; i.shiftedBy = function(t) { _(t, -d, d); return this.times('1e' + t); }; i.squareRoot = i.sqrt = function() { var t, r, n, i, o, s = this, a = s.c, f = s.s, u = s.e, c = M + 4, l = new L('0.5'); if (f !== 1 || !a || !a[0]) { return new L(!f || f < 0 && (!a || a[0]) ? NaN : a ? s : 1 / 0); } f = Math.sqrt(+W(s)); if (f == 0 || f == 1 / 0) { r = m(a); if ((r.length + u) % 2 == 0) r += '0'; f = Math.sqrt(+r); u = y((u + 1) / 2) - (u < 0 || u % 2); if (f == 1 / 0) { r = '5e' + u; } else { r = f.toExponential(); r = r.slice(0, r.indexOf('e') + 1) + u; } n = new L(r); } else { n = new L(f + ''); } if (n.c[0]) { u = n.e; f = u + c; if (f < 3) f = 0; for(;;){ o = n; n = l.times(o.plus(e(s, o, c, 1))); if (m(o.c).slice(0, f) === (r = m(n.c)).slice(0, f)) { if (n.e < u) --f; r = r.slice(f - 3, f + 1); if (r == '9999' || !i && r == '4999') { if (!i) { F(o, o.e + M + 2, 0); if (o.times(o).eq(s)) { n = o; break; } } c += 4; f += 4; i = 1; } else { if (!+r || !+r.slice(1) && r.charAt(0) == '5') { F(n, n.e + M + 2, 1); t = !n.times(n).eq(s); } break; } } } } return F(n, n.e + M + 1, T, t); }; i.toExponential = function(t, e) { if (t != null) { _(t, 0, b); t++; } return U(this, t, e, 1); }; i.toFixed = function(t, e) { if (t != null) { _(t, 0, b); t = t + this.e + 1; } return U(this, t, e); }; i.toFormat = function(t, e, r) { var n, i = this; if (r == null) { if (t != null && e && typeof e == 'object') { r = e; e = null; } else if (t && typeof t == 'object') { r = t; t = e = null; } else { r = P; } } else if (typeof r != 'object') { throw Error(u + 'Argument not an object: ' + r); } n = i.toFixed(t, e); if (i.c) { var o, s = n.split('.'), a = +r.groupSize, f = +r.secondaryGroupSize, c = r.groupSeparator || '', l = s[0], h = s[1], d = i.s < 0, p = d ? l.slice(1) : l, g = p.length; if (f) { o = a; a = f; f = o; g -= o; } if (a > 0 && g > 0) { o = g % a || a; l = p.substr(0, o); for(; o < g; o += a)l += c + p.substr(o, a); if (f > 0) l += c + p.slice(o); if (d) l = '-' + l; } n = h ? l + (r.decimalSeparator || '') + ((f = +r.fractionGroupSize) ? h.replace(new RegExp('\\d{' + f + '}\\B', 'g'), '$&' + (r.fractionGroupSeparator || '')) : h) : l; } return (r.prefix || '') + n + (r.suffix || ''); }; i.toFraction = function(t) { var r, n, i, s, a, f, c, l, d, g, b, v, y = this, w = y.c; if (t != null) { c = new L(t); if (!c.isInteger() && (c.c || c.s !== 1) || c.lt(o)) { throw Error(u + 'Argument ' + (c.isInteger() ? 'out of range: ' : 'not an integer: ') + W(c)); } } if (!w) return new L(y); r = new L(o); d = n = new L(o); i = l = new L(o); v = m(w); a = r.e = v.length - y.e - 1; r.c[0] = p[(f = a % h) < 0 ? h + f : f]; t = !t || c.comparedTo(r) > 0 ? (a > 0 ? r : d) : c; f = I; I = 1 / 0; c = new L(v); l.c[0] = 0; for(;;){ g = e(c, r, 0, 1); s = n.plus(g.times(i)); if (s.comparedTo(t) == 1) break; n = i; i = s; d = l.plus(g.times(s = d)); l = s; r = c.minus(g.times(s = r)); c = s; } s = e(t.minus(n), i, 0, 1); l = l.plus(s.times(d)); n = n.plus(s.times(i)); l.s = d.s = y.s; a = a * 2; b = e(d, i, a, T).minus(y).abs().comparedTo(e(l, n, a, T).minus(y).abs()) < 1 ? [ d, i ] : [ l, n ]; I = f; return b; }; i.toNumber = function() { return +W(this); }; i.toPrecision = function(t, e) { if (t != null) _(t, 1, b); return U(this, t, e, 2); }; i.toString = function(t) { var e, n = this, i = n.s, o = n.e; if (o === null) { if (i) { e = 'Infinity'; if (i < 0) e = '-' + e; } else { e = 'NaN'; } } else { if (t == null) { e = o <= A || o >= O ? E(m(n.c), o) : x(m(n.c), o, '0'); } else if (t === 10 && B) { n = F(new L(n), M + o + 1, T); e = x(m(n.c), n.e, '0'); } else { _(t, 2, C.length, 'Base'); e = r(x(m(n.c), o, '0'), 10, t, i, true); } if (i < 0 && n.c[0]) e = '-' + e; } return e; }; i.valueOf = i.toJSON = function() { return W(this); }; i._isBigNumber = true; if (t != null) L.set(t); return L; } function y(t) { var e = t | 0; return t > 0 || t === e ? e : e - 1; } function m(t) { var e, r, n = 1, i = t.length, o = t[0] + ''; for(; n < i;){ e = t[n++] + ''; r = h - e.length; for(; r--; e = '0' + e); o += e; } for(i = o.length; o.charCodeAt(--i) === 48;); return o.slice(0, i + 1 || 1); } function w(t, e) { var r, n, i = t.c, o = e.c, s = t.s, a = e.s, f = t.e, u = e.e; if (!s || !a) return null; r = i && !i[0]; n = o && !o[0]; if (r || n) return r ? n ? 0 : -a : s; if (s != a) return s; r = s < 0; n = f == u; if (!i || !o) return n ? 0 : !i ^ r ? 1 : -1; if (!n) return f > u ^ r ? 1 : -1; a = (f = i.length) < (u = o.length) ? f : u; for(s = 0; s < a; s++)if (i[s] != o[s]) return i[s] > o[s] ^ r ? 1 : -1; return f == u ? 0 : f > u ^ r ? 1 : -1; } function _(t, e, r, n) { if (t < e || t > r || t !== f(t)) { throw Error(u + (n || 'Argument') + (typeof t == 'number' ? t < e || t > r ? ' out of range: ' : ' not an integer: ' : ' not a primitive number: ') + String(t)); } } function S(t) { var e = t.c.length - 1; return y(t.e / h) == e && t.c[e] % 2 != 0; } function E(t, e) { return (t.length > 1 ? t.charAt(0) + '.' + t.slice(1) : t) + (e < 0 ? 'e' : 'e+') + e; } function x(t, e, r) { var n, i; if (e < 0) { for(i = r + '.'; ++e; i += r); t = i + t; } else { n = t.length; if (++e > n) { for(i = r, e -= n; --e; i += r); t += i; } else if (e < n) { t = t.slice(0, e) + '.' + t.slice(e); } } return t; } o = v(); o['default'] = o.BigNumber = o; if (true) { !(n = (function() { return o; }).call(e, r, e, t), n !== undefined && (t.exports = n)); } else {} })(this); }), 3550: (function(t, e, r) { t = r.nmd(t); (function(t, e) { 'use strict'; function n(t, e) { if (!t) throw new Error(e || 'Assertion failed'); } function i(t, e) { t.super_ = e; var r = function() {}; r.prototype = e.prototype; t.prototype = new r(); t.prototype.constructor = t; } function o(t, e, r) { if (o.isBN(t)) { return t; } this.negative = 0; this.words = null; this.length = 0; this.red = null; if (t !== null) { if (e === 'le' || e === 'be') { r = e; e = 10; } this._init(t || 0, e || 10, r || 'be'); } } if (typeof t === 'object') { t.exports = o; } else { e.BN = o; } o.BN = o; o.wordSize = 26; var s; try { if (typeof window !== 'undefined' && typeof window.Buffer !== 'undefined') { s = window.Buffer; } else { s = (r(6601).Buffer); } } catch (a) {} o.isBN = function t(e) { if (e instanceof o) { return true; } return e !== null && typeof e === 'object' && e.constructor.wordSize === o.wordSize && Array.isArray(e.words); }; o.max = function t(e, r) { if (e.cmp(r) > 0) return e; return r; }; o.min = function t(e, r) { if (e.cmp(r) < 0) return e; return r; }; o.prototype._init = function t(e, r, i) { if (typeof e === 'number') { return this._initNumber(e, r, i); } if (typeof e === 'object') { return this._initArray(e, r, i); } if (r === 'hex') { r = 16; } n(r === (r | 0) && r >= 2 && r <= 36); e = e.toString().replace(/\s+/g, ''); var o = 0; if (e[0] === '-') { o++; this.negative = 1; } if (o < e.length) { if (r === 16) { this._parseHex(e, o, i); } else { this._parseBase(e, r, o); if (i === 'le') { this._initArray(this.toArray(), r, i); } } } }; o.prototype._initNumber = function t(e, r, i) { if (e < 0) { this.negative = 1; e = -e; } if (e < 0x4000000) { this.words = [ e & 0x3ffffff ]; this.length = 1; } else if (e < 0x10000000000000) { this.words = [ e & 0x3ffffff, (e / 0x4000000) & 0x3ffffff ]; this.length = 2; } else { n(e < 0x20000000000000); this.words = [ e & 0x3ffffff, (e / 0x4000000) & 0x3ffffff, 1 ]; this.length = 3; } if (i !== 'le') return; this._initArray(this.toArray(), r, i); }; o.prototype._initArray = function t(e, r, i) { n(typeof e.length === 'number'); if (e.length <= 0) { this.words = [ 0 ]; this.length = 1; return this; } this.length = Math.ceil(e.length / 3); this.words = new Array(this.length); for(var o = 0; o < this.length; o++){ this.words[o] = 0; } var s, a; var f = 0; if (i === 'be') { for(o = e.length - 1, s = 0; o >= 0; o -= 3){ a = e[o] | (e[o - 1] << 8) | (e[o - 2] << 16); this.words[s] |= (a << f) & 0x3ffffff; this.words[s + 1] = (a >>> (26 - f)) & 0x3ffffff; f += 24; if (f >= 26) { f -= 26; s++; } } } else if (i === 'le') { for(o = 0, s = 0; o < e.length; o += 3){ a = e[o] | (e[o + 1] << 8) | (e[o + 2] << 16); this.words[s] |= (a << f) & 0x3ffffff; this.words[s + 1] = (a >>> (26 - f)) & 0x3ffffff; f += 24; if (f >= 26) { f -= 26; s++; } } } return this.strip(); }; function f(t, e) { var r = t.charCodeAt(e); if (r >= 65 && r <= 70) { return r - 55; } else if (r >= 97 && r <= 102) { return r - 87; } else { return (r - 48) & 0xf; } } function u(t, e, r) { var n = f(t, r); if (r - 1 >= e) { n |= f(t, r - 1) << 4; } return n; } o.prototype._parseHex = function t(e, r, n) { this.length = Math.ceil((e.length - r) / 6); this.words = new Array(this.length); for(var i = 0; i < this.length; i++){ this.words[i] = 0; } var o = 0; var s = 0; var a; if (n === 'be') { for(i = e.length - 1; i >= r; i -= 2){ a = u(e, r, i) << o; this.words[s] |= a & 0x3ffffff; if (o >= 18) { o -= 18; s += 1; this.words[s] |= a >>> 26; } else { o += 8; } } } else { var f = e.length - r; for(i = f % 2 === 0 ? r + 1 : r; i < e.length; i += 2){ a = u(e, r, i) << o; this.words[s] |= a & 0x3ffffff; if (o >= 18) { o -= 18; s += 1; this.words[s] |= a >>> 26; } else { o += 8; } } } this.strip(); }; function c(t, e, r, n) { var i = 0; var o = Math.min(t.length, r); for(var s = e; s < o; s++){ var a = t.charCodeAt(s) - 48; i *= n; if (a >= 49) { i += a - 49 + 0xa; } else if (a >= 17) { i += a - 17 + 0xa; } else { i += a; } } return i; } o.prototype._parseBase = function t(e, r, n) { this.words = [ 0 ]; this.length = 1; for(var i = 0, o = 1; o <= 0x3ffffff; o *= r){ i++; } i--; o = (o / r) | 0; var s = e.length - n; var a = s % i; var f = Math.min(s, s - a) + n; var u = 0; for(var l = n; l < f; l += i){ u = c(e, l, l + i, r); this.imuln(o); if (this.words[0] + u < 0x4000000) { this.words[0] += u; } else { this._iaddn(u); } } if (a !== 0) { var h = 1; u = c(e, l, e.length, r); for(l = 0; l < a; l++){ h *= r; } this.imuln(h); if (this.words[0] + u < 0x4000000) { this.words[0] += u; } else { this._iaddn(u); } } this.strip(); }; o.prototype.copy = function t(e) { e.words = new Array(this.length); for(var r = 0; r < this.length; r++){ e.words[r] = this.words[r]; } e.length = this.length; e.negative = this.negative; e.red = this.red; }; o.prototype.clone = function t() { var e = new o(null); this.copy(e); return e; }; o.prototype._expand = function t(e) { while(this.length < e){ this.words[this.length++] = 0; } return this; }; o.prototype.strip = function t() { while(this.length > 1 && this.words[this.length - 1] === 0){ this.length--; } return this._normSign(); }; o.prototype._normSign = function t() { if (this.length === 1 && this.words[0] === 0) { this.negative = 0; } return this; }; o.prototype.inspect = function t() { return (this.red ? ''; }; var l = [ '', '0', '00', '000', '0000', '00000', '000000', '0000000', '00000000', '000000000', '0000000000', '00000000000', '000000000000', '0000000000000', '00000000000000', '000000000000000', '0000000000000000', '00000000000000000', '000000000000000000', '0000000000000000000', '00000000000000000000', '000000000000000000000', '0000000000000000000000', '00000000000000000000000', '000000000000000000000000', '0000000000000000000000000' ]; var h = [ 0, 0, 25, 16, 12, 11, 10, 9, 8, 8, 7, 7, 7, 7, 6, 6, 6, 6, 6, 6, 6, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 ]; var d = [ 0, 0, 33554432, 43046721, 16777216, 48828125, 60466176, 40353607, 16777216, 43046721, 10000000, 19487171, 35831808, 62748517, 7529536, 11390625, 16777216, 24137569, 34012224, 47045881, 64000000, 4084101, 5153632, 6436343, 7962624, 9765625, 11881376, 14348907, 17210368, 20511149, 24300000, 28629151, 33554432, 39135393, 45435424, 52521875, 60466176 ]; o.prototype.toString = function t(e, r) { e = e || 10; r = r | 0 || 1; var i; if (e === 16 || e === 'hex') { i = ''; var o = 0; var s = 0; for(var a = 0; a < this.length; a++){ var f = this.words[a]; var u = (((f << o) | s) & 0xffffff).toString(16); s = (f >>> (24 - o)) & 0xffffff; if (s !== 0 || a !== this.length - 1) { i = l[6 - u.length] + u + i; } else { i = u + i; } o += 2; if (o >= 26) { o -= 26; a--; } } if (s !== 0) { i = s.toString(16) + i; } while(i.length % r !== 0){ i = '0' + i; } if (this.negative !== 0) { i = '-' + i; } return i; } if (e === (e | 0) && e >= 2 && e <= 36) { var c = h[e]; var p = d[e]; i = ''; var g = this.clone(); g.negative = 0; while(!g.isZero()){ var b = g.modn(p).toString(e); g = g.idivn(p); if (!g.isZero()) { i = l[c - b.length] + b + i; } else { i = b + i; } } if (this.isZero()) { i = '0' + i; } while(i.length % r !== 0){ i = '0' + i; } if (this.negative !== 0) { i = '-' + i; } return i; } n(false, 'Base should be between 2 and 36'); }; o.prototype.toNumber = function t() { var e = this.words[0]; if (this.length === 2) { e += this.words[1] * 0x4000000; } else if (this.length === 3 && this.words[2] === 0x01) { e += 0x10000000000000 + (this.words[1] * 0x4000000); } else if (this.length > 2) { n(false, 'Number can only safely store up to 53 bits'); } return (this.negative !== 0) ? -e : e; }; o.prototype.toJSON = function t() { return this.toString(16); }; o.prototype.toBuffer = function t(e, r) { n(typeof s !== 'undefined'); return this.toArrayLike(s, e, r); }; o.prototype.toArray = function t(e, r) { return this.toArrayLike(Array, e, r); }; o.prototype.toArrayLike = function t(e, r, i) { var o = this.byteLength(); var s = i || Math.max(1, o); n(o <= s, 'byte array longer than desired length'); n(s > 0, 'Requested array length <= 0'); this.strip(); var a = r === 'le'; var f = new e(s); var u, c; var l = this.clone(); if (!a) { for(c = 0; c < s - o; c++){ f[c] = 0; } for(c = 0; !l.isZero(); c++){ u = l.andln(0xff); l.iushrn(8); f[s - c - 1] = u; } } else { for(c = 0; !l.isZero(); c++){ u = l.andln(0xff); l.iushrn(8); f[c] = u; } for(; c < s; c++){ f[c] = 0; } } return f; }; if (Math.clz32) { o.prototype._countBits = function t(e) { return 32 - Math.clz32(e); }; } else { o.prototype._countBits = function t(e) { var r = e; var n = 0; if (r >= 0x1000) { n += 13; r >>>= 13; } if (r >= 0x40) { n += 7; r >>>= 7; } if (r >= 0x8) { n += 4; r >>>= 4; } if (r >= 0x02) { n += 2; r >>>= 2; } return n + r; }; } o.prototype._zeroBits = function t(e) { if (e === 0) return 26; var r = e; var n = 0; if ((r & 0x1fff) === 0) { n += 13; r >>>= 13; } if ((r & 0x7f) === 0) { n += 7; r >>>= 7; } if ((r & 0xf) === 0) { n += 4; r >>>= 4; } if ((r & 0x3) === 0) { n += 2; r >>>= 2; } if ((r & 0x1) === 0) { n++; } return n; }; o.prototype.bitLength = function t() { var e = this.words[this.length - 1]; var r = this._countBits(e); return (this.length - 1) * 26 + r; }; function p(t) { var e = new Array(t.bitLength()); for(var r = 0; r < e.length; r++){ var n = (r / 26) | 0; var i = r % 26; e[r] = (t.words[n] & (1 << i)) >>> i; } return e; } o.prototype.zeroBits = function t() { if (this.isZero()) return 0; var e = 0; for(var r = 0; r < this.length; r++){ var n = this._zeroBits(this.words[r]); e += n; if (n !== 26) break; } return e; }; o.prototype.byteLength = function t() { return Math.ceil(this.bitLength() / 8); }; o.prototype.toTwos = function t(e) { if (this.negative !== 0) { return this.abs().inotn(e).iaddn(1); } return this.clone(); }; o.prototype.fromTwos = function t(e) { if (this.testn(e - 1)) { return this.notn(e).iaddn(1).ineg(); } return this.clone(); }; o.prototype.isNeg = function t() { return this.negative !== 0; }; o.prototype.neg = function t() { return this.clone().ineg(); }; o.prototype.ineg = function t() { if (!this.isZero()) { this.negative ^= 1; } return this; }; o.prototype.iuor = function t(e) { while(this.length < e.length){ this.words[this.length++] = 0; } for(var r = 0; r < e.length; r++){ this.words[r] = this.words[r] | e.words[r]; } return this.strip(); }; o.prototype.ior = function t(e) { n((this.negative | e.negative) === 0); return this.iuor(e); }; o.prototype.or = function t(e) { if (this.length > e.length) return this.clone().ior(e); return e.clone().ior(this); }; o.prototype.uor = function t(e) { if (this.length > e.length) return this.clone().iuor(e); return e.clone().iuor(this); }; o.prototype.iuand = function t(e) { var r; if (this.length > e.length) { r = e; } else { r = this; } for(var n = 0; n < r.length; n++){ this.words[n] = this.words[n] & e.words[n]; } this.length = r.length; return this.strip(); }; o.prototype.iand = function t(e) { n((this.negative | e.negative) === 0); return this.iuand(e); }; o.prototype.and = function t(e) { if (this.length > e.length) return this.clone().iand(e); return e.clone().iand(this); }; o.prototype.uand = function t(e) { if (this.length > e.length) return this.clone().iuand(e); return e.clone().iuand(this); }; o.prototype.iuxor = function t(e) { var r; var n; if (this.length > e.length) { r = this; n = e; } else { r = e; n = this; } for(var i = 0; i < n.length; i++){ this.words[i] = r.words[i] ^ n.words[i]; } if (this !== r) { for(; i < r.length; i++){ this.words[i] = r.words[i]; } } this.length = r.length; return this.strip(); }; o.prototype.ixor = function t(e) { n((this.negative | e.negative) === 0); return this.iuxor(e); }; o.prototype.xor = function t(e) { if (this.length > e.length) return this.clone().ixor(e); return e.clone().ixor(this); }; o.prototype.uxor = function t(e) { if (this.length > e.length) return this.clone().iuxor(e); return e.clone().iuxor(this); }; o.prototype.inotn = function t(e) { n(typeof e === 'number' && e >= 0); var r = Math.ceil(e / 26) | 0; var i = e % 26; this._expand(r); if (i > 0) { r--; } for(var o = 0; o < r; o++){ this.words[o] = ~this.words[o] & 0x3ffffff; } if (i > 0) { this.words[o] = ~this.words[o] & (0x3ffffff >> (26 - i)); } return this.strip(); }; o.prototype.notn = function t(e) { return this.clone().inotn(e); }; o.prototype.setn = function t(e, r) { n(typeof e === 'number' && e >= 0); var i = (e / 26) | 0; var o = e % 26; this._expand(i + 1); if (r) { this.words[i] = this.words[i] | (1 << o); } else { this.words[i] = this.words[i] & ~(1 << o); } return this.strip(); }; o.prototype.iadd = function t(e) { var r; if (this.negative !== 0 && e.negative === 0) { this.negative = 0; r = this.isub(e); this.negative ^= 1; return this._normSign(); } else if (this.negative === 0 && e.negative !== 0) { e.negative = 0; r = this.isub(e); e.negative = 1; return r._normSign(); } var n, i; if (this.length > e.length) { n = this; i = e; } else { n = e; i = this; } var o = 0; for(var s = 0; s < i.length; s++){ r = (n.words[s] | 0) + (i.words[s] | 0) + o; this.words[s] = r & 0x3ffffff; o = r >>> 26; } for(; o !== 0 && s < n.length; s++){ r = (n.words[s] | 0) + o; this.words[s] = r & 0x3ffffff; o = r >>> 26; } this.length = n.length; if (o !== 0) { this.words[this.length] = o; this.length++; } else if (n !== this) { for(; s < n.length; s++){ this.words[s] = n.words[s]; } } return this; }; o.prototype.add = function t(e) { var r; if (e.negative !== 0 && this.negative === 0) { e.negative = 0; r = this.sub(e); e.negative ^= 1; return r; } else if (e.negative === 0 && this.negative !== 0) { this.negative = 0; r = e.sub(this); this.negative = 1; return r; } if (this.length > e.length) return this.clone().iadd(e); return e.clone().iadd(this); }; o.prototype.isub = function t(e) { if (e.negative !== 0) { e.negative = 0; var r = this.iadd(e); e.negative = 1; return r._normSign(); } else if (this.negative !== 0) { this.negative = 0; this.iadd(e); this.negative = 1; return this._normSign(); } var n = this.cmp(e); if (n === 0) { this.negative = 0; this.length = 1; this.words[0] = 0; return this; } var i, o; if (n > 0) { i = this; o = e; } else { i = e; o = this; } var s = 0; for(var a = 0; a < o.length; a++){ r = (i.words[a] | 0) - (o.words[a] | 0) + s; s = r >> 26; this.words[a] = r & 0x3ffffff; } for(; s !== 0 && a < i.length; a++){ r = (i.words[a] | 0) + s; s = r >> 26; this.words[a] = r & 0x3ffffff; } if (s === 0 && a < i.length && i !== this) { for(; a < i.length; a++){ this.words[a] = i.words[a]; } } this.length = Math.max(this.length, a); if (i !== this) { this.negative = 1; } return this.strip(); }; o.prototype.sub = function t(e) { return this.clone().isub(e); }; function g(t, e, r) { r.negative = e.negative ^ t.negative; var n = (t.length + e.length) | 0; r.length = n; n = (n - 1) | 0; var i = t.words[0] | 0; var o = e.words[0] | 0; var s = i * o; var a = s & 0x3ffffff; var f = (s / 0x4000000) | 0; r.words[0] = a; for(var u = 1; u < n; u++){ var c = f >>> 26; var l = f & 0x3ffffff; var h = Math.min(u, e.length - 1); for(var d = Math.max(0, u - t.length + 1); d <= h; d++){ var p = (u - d) | 0; i = t.words[p] | 0; o = e.words[d] | 0; s = i * o + l; c += (s / 0x4000000) | 0; l = s & 0x3ffffff; } r.words[u] = l | 0; f = c | 0; } if (f !== 0) { r.words[u] = f | 0; } else { r.length--; } return r.strip(); } var b = function t(e, r, n) { var i = e.words; var o = r.words; var s = n.words; var a = 0; var f; var u; var c; var l = i[0] | 0; var h = l & 0x1fff; var d = l >>> 13; var p = i[1] | 0; var g = p & 0x1fff; var b = p >>> 13; var v = i[2] | 0; var y = v & 0x1fff; var m = v >>> 13; var w = i[3] | 0; var _ = w & 0x1fff; var S = w >>> 13; var E = i[4] | 0; var x = E & 0x1fff; var M = E >>> 13; var T = i[5] | 0; var A = T & 0x1fff; var O = T >>> 13; var k = i[6] | 0; var I = k & 0x1fff; var R = k >>> 13; var N = i[7] | 0; var j = N & 0x1fff; var P = N >>> 13; var C = i[8] | 0; var B = C & 0x1fff; var L = C >>> 13; var U = i[9] | 0; var D = U & 0x1fff; var $ = U >>> 13; var F = o[0] | 0; var W = F & 0x1fff; var q = F >>> 13; var z = o[1] | 0; var G = z & 0x1fff; var K = z >>> 13; var V = o[2] | 0; var H = V & 0x1fff; var J = V >>> 13; var X = o[3] | 0; var Y = X & 0x1fff; var Z = X >>> 13; var Q = o[4] | 0; var tt = Q & 0x1fff; var te = Q >>> 13; var tr = o[5] | 0; var tn = tr & 0x1fff; var ti = tr >>> 13; var to = o[6] | 0; var ts = to & 0x1fff; var ta = to >>> 13; var tf = o[7] | 0; var tu = tf & 0x1fff; var tc = tf >>> 13; var tl = o[8] | 0; var th = tl & 0x1fff; var td = tl >>> 13; var tp = o[9] | 0; var tg = tp & 0x1fff; var tb = tp >>> 13; n.negative = e.negative ^ r.negative; n.length = 19; f = Math.imul(h, W); u = Math.imul(h, q); u = (u + Math.imul(d, W)) | 0; c = Math.imul(d, q); var tv = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tv >>> 26)) | 0; tv &= 0x3ffffff; f = Math.imul(g, W); u = Math.imul(g, q); u = (u + Math.imul(b, W)) | 0; c = Math.imul(b, q); f = (f + Math.imul(h, G)) | 0; u = (u + Math.imul(h, K)) | 0; u = (u + Math.imul(d, G)) | 0; c = (c + Math.imul(d, K)) | 0; var ty = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (ty >>> 26)) | 0; ty &= 0x3ffffff; f = Math.imul(y, W); u = Math.imul(y, q); u = (u + Math.imul(m, W)) | 0; c = Math.imul(m, q); f = (f + Math.imul(g, G)) | 0; u = (u + Math.imul(g, K)) | 0; u = (u + Math.imul(b, G)) | 0; c = (c + Math.imul(b, K)) | 0; f = (f + Math.imul(h, H)) | 0; u = (u + Math.imul(h, J)) | 0; u = (u + Math.imul(d, H)) | 0; c = (c + Math.imul(d, J)) | 0; var tm = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tm >>> 26)) | 0; tm &= 0x3ffffff; f = Math.imul(_, W); u = Math.imul(_, q); u = (u + Math.imul(S, W)) | 0; c = Math.imul(S, q); f = (f + Math.imul(y, G)) | 0; u = (u + Math.imul(y, K)) | 0; u = (u + Math.imul(m, G)) | 0; c = (c + Math.imul(m, K)) | 0; f = (f + Math.imul(g, H)) | 0; u = (u + Math.imul(g, J)) | 0; u = (u + Math.imul(b, H)) | 0; c = (c + Math.imul(b, J)) | 0; f = (f + Math.imul(h, Y)) | 0; u = (u + Math.imul(h, Z)) | 0; u = (u + Math.imul(d, Y)) | 0; c = (c + Math.imul(d, Z)) | 0; var tw = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tw >>> 26)) | 0; tw &= 0x3ffffff; f = Math.imul(x, W); u = Math.imul(x, q); u = (u + Math.imul(M, W)) | 0; c = Math.imul(M, q); f = (f + Math.imul(_, G)) | 0; u = (u + Math.imul(_, K)) | 0; u = (u + Math.imul(S, G)) | 0; c = (c + Math.imul(S, K)) | 0; f = (f + Math.imul(y, H)) | 0; u = (u + Math.imul(y, J)) | 0; u = (u + Math.imul(m, H)) | 0; c = (c + Math.imul(m, J)) | 0; f = (f + Math.imul(g, Y)) | 0; u = (u + Math.imul(g, Z)) | 0; u = (u + Math.imul(b, Y)) | 0; c = (c + Math.imul(b, Z)) | 0; f = (f + Math.imul(h, tt)) | 0; u = (u + Math.imul(h, te)) | 0; u = (u + Math.imul(d, tt)) | 0; c = (c + Math.imul(d, te)) | 0; var t_ = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (t_ >>> 26)) | 0; t_ &= 0x3ffffff; f = Math.imul(A, W); u = Math.imul(A, q); u = (u + Math.imul(O, W)) | 0; c = Math.imul(O, q); f = (f + Math.imul(x, G)) | 0; u = (u + Math.imul(x, K)) | 0; u = (u + Math.imul(M, G)) | 0; c = (c + Math.imul(M, K)) | 0; f = (f + Math.imul(_, H)) | 0; u = (u + Math.imul(_, J)) | 0; u = (u + Math.imul(S, H)) | 0; c = (c + Math.imul(S, J)) | 0; f = (f + Math.imul(y, Y)) | 0; u = (u + Math.imul(y, Z)) | 0; u = (u + Math.imul(m, Y)) | 0; c = (c + Math.imul(m, Z)) | 0; f = (f + Math.imul(g, tt)) | 0; u = (u + Math.imul(g, te)) | 0; u = (u + Math.imul(b, tt)) | 0; c = (c + Math.imul(b, te)) | 0; f = (f + Math.imul(h, tn)) | 0; u = (u + Math.imul(h, ti)) | 0; u = (u + Math.imul(d, tn)) | 0; c = (c + Math.imul(d, ti)) | 0; var tS = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tS >>> 26)) | 0; tS &= 0x3ffffff; f = Math.imul(I, W); u = Math.imul(I, q); u = (u + Math.imul(R, W)) | 0; c = Math.imul(R, q); f = (f + Math.imul(A, G)) | 0; u = (u + Math.imul(A, K)) | 0; u = (u + Math.imul(O, G)) | 0; c = (c + Math.imul(O, K)) | 0; f = (f + Math.imul(x, H)) | 0; u = (u + Math.imul(x, J)) | 0; u = (u + Math.imul(M, H)) | 0; c = (c + Math.imul(M, J)) | 0; f = (f + Math.imul(_, Y)) | 0; u = (u + Math.imul(_, Z)) | 0; u = (u + Math.imul(S, Y)) | 0; c = (c + Math.imul(S, Z)) | 0; f = (f + Math.imul(y, tt)) | 0; u = (u + Math.imul(y, te)) | 0; u = (u + Math.imul(m, tt)) | 0; c = (c + Math.imul(m, te)) | 0; f = (f + Math.imul(g, tn)) | 0; u = (u + Math.imul(g, ti)) | 0; u = (u + Math.imul(b, tn)) | 0; c = (c + Math.imul(b, ti)) | 0; f = (f + Math.imul(h, ts)) | 0; u = (u + Math.imul(h, ta)) | 0; u = (u + Math.imul(d, ts)) | 0; c = (c + Math.imul(d, ta)) | 0; var tE = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tE >>> 26)) | 0; tE &= 0x3ffffff; f = Math.imul(j, W); u = Math.imul(j, q); u = (u + Math.imul(P, W)) | 0; c = Math.imul(P, q); f = (f + Math.imul(I, G)) | 0; u = (u + Math.imul(I, K)) | 0; u = (u + Math.imul(R, G)) | 0; c = (c + Math.imul(R, K)) | 0; f = (f + Math.imul(A, H)) | 0; u = (u + Math.imul(A, J)) | 0; u = (u + Math.imul(O, H)) | 0; c = (c + Math.imul(O, J)) | 0; f = (f + Math.imul(x, Y)) | 0; u = (u + Math.imul(x, Z)) | 0; u = (u + Math.imul(M, Y)) | 0; c = (c + Math.imul(M, Z)) | 0; f = (f + Math.imul(_, tt)) | 0; u = (u + Math.imul(_, te)) | 0; u = (u + Math.imul(S, tt)) | 0; c = (c + Math.imul(S, te)) | 0; f = (f + Math.imul(y, tn)) | 0; u = (u + Math.imul(y, ti)) | 0; u = (u + Math.imul(m, tn)) | 0; c = (c + Math.imul(m, ti)) | 0; f = (f + Math.imul(g, ts)) | 0; u = (u + Math.imul(g, ta)) | 0; u = (u + Math.imul(b, ts)) | 0; c = (c + Math.imul(b, ta)) | 0; f = (f + Math.imul(h, tu)) | 0; u = (u + Math.imul(h, tc)) | 0; u = (u + Math.imul(d, tu)) | 0; c = (c + Math.imul(d, tc)) | 0; var tx = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tx >>> 26)) | 0; tx &= 0x3ffffff; f = Math.imul(B, W); u = Math.imul(B, q); u = (u + Math.imul(L, W)) | 0; c = Math.imul(L, q); f = (f + Math.imul(j, G)) | 0; u = (u + Math.imul(j, K)) | 0; u = (u + Math.imul(P, G)) | 0; c = (c + Math.imul(P, K)) | 0; f = (f + Math.imul(I, H)) | 0; u = (u + Math.imul(I, J)) | 0; u = (u + Math.imul(R, H)) | 0; c = (c + Math.imul(R, J)) | 0; f = (f + Math.imul(A, Y)) | 0; u = (u + Math.imul(A, Z)) | 0; u = (u + Math.imul(O, Y)) | 0; c = (c + Math.imul(O, Z)) | 0; f = (f + Math.imul(x, tt)) | 0; u = (u + Math.imul(x, te)) | 0; u = (u + Math.imul(M, tt)) | 0; c = (c + Math.imul(M, te)) | 0; f = (f + Math.imul(_, tn)) | 0; u = (u + Math.imul(_, ti)) | 0; u = (u + Math.imul(S, tn)) | 0; c = (c + Math.imul(S, ti)) | 0; f = (f + Math.imul(y, ts)) | 0; u = (u + Math.imul(y, ta)) | 0; u = (u + Math.imul(m, ts)) | 0; c = (c + Math.imul(m, ta)) | 0; f = (f + Math.imul(g, tu)) | 0; u = (u + Math.imul(g, tc)) | 0; u = (u + Math.imul(b, tu)) | 0; c = (c + Math.imul(b, tc)) | 0; f = (f + Math.imul(h, th)) | 0; u = (u + Math.imul(h, td)) | 0; u = (u + Math.imul(d, th)) | 0; c = (c + Math.imul(d, td)) | 0; var tM = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tM >>> 26)) | 0; tM &= 0x3ffffff; f = Math.imul(D, W); u = Math.imul(D, q); u = (u + Math.imul($, W)) | 0; c = Math.imul($, q); f = (f + Math.imul(B, G)) | 0; u = (u + Math.imul(B, K)) | 0; u = (u + Math.imul(L, G)) | 0; c = (c + Math.imul(L, K)) | 0; f = (f + Math.imul(j, H)) | 0; u = (u + Math.imul(j, J)) | 0; u = (u + Math.imul(P, H)) | 0; c = (c + Math.imul(P, J)) | 0; f = (f + Math.imul(I, Y)) | 0; u = (u + Math.imul(I, Z)) | 0; u = (u + Math.imul(R, Y)) | 0; c = (c + Math.imul(R, Z)) | 0; f = (f + Math.imul(A, tt)) | 0; u = (u + Math.imul(A, te)) | 0; u = (u + Math.imul(O, tt)) | 0; c = (c + Math.imul(O, te)) | 0; f = (f + Math.imul(x, tn)) | 0; u = (u + Math.imul(x, ti)) | 0; u = (u + Math.imul(M, tn)) | 0; c = (c + Math.imul(M, ti)) | 0; f = (f + Math.imul(_, ts)) | 0; u = (u + Math.imul(_, ta)) | 0; u = (u + Math.imul(S, ts)) | 0; c = (c + Math.imul(S, ta)) | 0; f = (f + Math.imul(y, tu)) | 0; u = (u + Math.imul(y, tc)) | 0; u = (u + Math.imul(m, tu)) | 0; c = (c + Math.imul(m, tc)) | 0; f = (f + Math.imul(g, th)) | 0; u = (u + Math.imul(g, td)) | 0; u = (u + Math.imul(b, th)) | 0; c = (c + Math.imul(b, td)) | 0; f = (f + Math.imul(h, tg)) | 0; u = (u + Math.imul(h, tb)) | 0; u = (u + Math.imul(d, tg)) | 0; c = (c + Math.imul(d, tb)) | 0; var tT = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tT >>> 26)) | 0; tT &= 0x3ffffff; f = Math.imul(D, G); u = Math.imul(D, K); u = (u + Math.imul($, G)) | 0; c = Math.imul($, K); f = (f + Math.imul(B, H)) | 0; u = (u + Math.imul(B, J)) | 0; u = (u + Math.imul(L, H)) | 0; c = (c + Math.imul(L, J)) | 0; f = (f + Math.imul(j, Y)) | 0; u = (u + Math.imul(j, Z)) | 0; u = (u + Math.imul(P, Y)) | 0; c = (c + Math.imul(P, Z)) | 0; f = (f + Math.imul(I, tt)) | 0; u = (u + Math.imul(I, te)) | 0; u = (u + Math.imul(R, tt)) | 0; c = (c + Math.imul(R, te)) | 0; f = (f + Math.imul(A, tn)) | 0; u = (u + Math.imul(A, ti)) | 0; u = (u + Math.imul(O, tn)) | 0; c = (c + Math.imul(O, ti)) | 0; f = (f + Math.imul(x, ts)) | 0; u = (u + Math.imul(x, ta)) | 0; u = (u + Math.imul(M, ts)) | 0; c = (c + Math.imul(M, ta)) | 0; f = (f + Math.imul(_, tu)) | 0; u = (u + Math.imul(_, tc)) | 0; u = (u + Math.imul(S, tu)) | 0; c = (c + Math.imul(S, tc)) | 0; f = (f + Math.imul(y, th)) | 0; u = (u + Math.imul(y, td)) | 0; u = (u + Math.imul(m, th)) | 0; c = (c + Math.imul(m, td)) | 0; f = (f + Math.imul(g, tg)) | 0; u = (u + Math.imul(g, tb)) | 0; u = (u + Math.imul(b, tg)) | 0; c = (c + Math.imul(b, tb)) | 0; var tA = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tA >>> 26)) | 0; tA &= 0x3ffffff; f = Math.imul(D, H); u = Math.imul(D, J); u = (u + Math.imul($, H)) | 0; c = Math.imul($, J); f = (f + Math.imul(B, Y)) | 0; u = (u + Math.imul(B, Z)) | 0; u = (u + Math.imul(L, Y)) | 0; c = (c + Math.imul(L, Z)) | 0; f = (f + Math.imul(j, tt)) | 0; u = (u + Math.imul(j, te)) | 0; u = (u + Math.imul(P, tt)) | 0; c = (c + Math.imul(P, te)) | 0; f = (f + Math.imul(I, tn)) | 0; u = (u + Math.imul(I, ti)) | 0; u = (u + Math.imul(R, tn)) | 0; c = (c + Math.imul(R, ti)) | 0; f = (f + Math.imul(A, ts)) | 0; u = (u + Math.imul(A, ta)) | 0; u = (u + Math.imul(O, ts)) | 0; c = (c + Math.imul(O, ta)) | 0; f = (f + Math.imul(x, tu)) | 0; u = (u + Math.imul(x, tc)) | 0; u = (u + Math.imul(M, tu)) | 0; c = (c + Math.imul(M, tc)) | 0; f = (f + Math.imul(_, th)) | 0; u = (u + Math.imul(_, td)) | 0; u = (u + Math.imul(S, th)) | 0; c = (c + Math.imul(S, td)) | 0; f = (f + Math.imul(y, tg)) | 0; u = (u + Math.imul(y, tb)) | 0; u = (u + Math.imul(m, tg)) | 0; c = (c + Math.imul(m, tb)) | 0; var tO = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tO >>> 26)) | 0; tO &= 0x3ffffff; f = Math.imul(D, Y); u = Math.imul(D, Z); u = (u + Math.imul($, Y)) | 0; c = Math.imul($, Z); f = (f + Math.imul(B, tt)) | 0; u = (u + Math.imul(B, te)) | 0; u = (u + Math.imul(L, tt)) | 0; c = (c + Math.imul(L, te)) | 0; f = (f + Math.imul(j, tn)) | 0; u = (u + Math.imul(j, ti)) | 0; u = (u + Math.imul(P, tn)) | 0; c = (c + Math.imul(P, ti)) | 0; f = (f + Math.imul(I, ts)) | 0; u = (u + Math.imul(I, ta)) | 0; u = (u + Math.imul(R, ts)) | 0; c = (c + Math.imul(R, ta)) | 0; f = (f + Math.imul(A, tu)) | 0; u = (u + Math.imul(A, tc)) | 0; u = (u + Math.imul(O, tu)) | 0; c = (c + Math.imul(O, tc)) | 0; f = (f + Math.imul(x, th)) | 0; u = (u + Math.imul(x, td)) | 0; u = (u + Math.imul(M, th)) | 0; c = (c + Math.imul(M, td)) | 0; f = (f + Math.imul(_, tg)) | 0; u = (u + Math.imul(_, tb)) | 0; u = (u + Math.imul(S, tg)) | 0; c = (c + Math.imul(S, tb)) | 0; var tk = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tk >>> 26)) | 0; tk &= 0x3ffffff; f = Math.imul(D, tt); u = Math.imul(D, te); u = (u + Math.imul($, tt)) | 0; c = Math.imul($, te); f = (f + Math.imul(B, tn)) | 0; u = (u + Math.imul(B, ti)) | 0; u = (u + Math.imul(L, tn)) | 0; c = (c + Math.imul(L, ti)) | 0; f = (f + Math.imul(j, ts)) | 0; u = (u + Math.imul(j, ta)) | 0; u = (u + Math.imul(P, ts)) | 0; c = (c + Math.imul(P, ta)) | 0; f = (f + Math.imul(I, tu)) | 0; u = (u + Math.imul(I, tc)) | 0; u = (u + Math.imul(R, tu)) | 0; c = (c + Math.imul(R, tc)) | 0; f = (f + Math.imul(A, th)) | 0; u = (u + Math.imul(A, td)) | 0; u = (u + Math.imul(O, th)) | 0; c = (c + Math.imul(O, td)) | 0; f = (f + Math.imul(x, tg)) | 0; u = (u + Math.imul(x, tb)) | 0; u = (u + Math.imul(M, tg)) | 0; c = (c + Math.imul(M, tb)) | 0; var tI = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tI >>> 26)) | 0; tI &= 0x3ffffff; f = Math.imul(D, tn); u = Math.imul(D, ti); u = (u + Math.imul($, tn)) | 0; c = Math.imul($, ti); f = (f + Math.imul(B, ts)) | 0; u = (u + Math.imul(B, ta)) | 0; u = (u + Math.imul(L, ts)) | 0; c = (c + Math.imul(L, ta)) | 0; f = (f + Math.imul(j, tu)) | 0; u = (u + Math.imul(j, tc)) | 0; u = (u + Math.imul(P, tu)) | 0; c = (c + Math.imul(P, tc)) | 0; f = (f + Math.imul(I, th)) | 0; u = (u + Math.imul(I, td)) | 0; u = (u + Math.imul(R, th)) | 0; c = (c + Math.imul(R, td)) | 0; f = (f + Math.imul(A, tg)) | 0; u = (u + Math.imul(A, tb)) | 0; u = (u + Math.imul(O, tg)) | 0; c = (c + Math.imul(O, tb)) | 0; var tR = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tR >>> 26)) | 0; tR &= 0x3ffffff; f = Math.imul(D, ts); u = Math.imul(D, ta); u = (u + Math.imul($, ts)) | 0; c = Math.imul($, ta); f = (f + Math.imul(B, tu)) | 0; u = (u + Math.imul(B, tc)) | 0; u = (u + Math.imul(L, tu)) | 0; c = (c + Math.imul(L, tc)) | 0; f = (f + Math.imul(j, th)) | 0; u = (u + Math.imul(j, td)) | 0; u = (u + Math.imul(P, th)) | 0; c = (c + Math.imul(P, td)) | 0; f = (f + Math.imul(I, tg)) | 0; u = (u + Math.imul(I, tb)) | 0; u = (u + Math.imul(R, tg)) | 0; c = (c + Math.imul(R, tb)) | 0; var tN = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tN >>> 26)) | 0; tN &= 0x3ffffff; f = Math.imul(D, tu); u = Math.imul(D, tc); u = (u + Math.imul($, tu)) | 0; c = Math.imul($, tc); f = (f + Math.imul(B, th)) | 0; u = (u + Math.imul(B, td)) | 0; u = (u + Math.imul(L, th)) | 0; c = (c + Math.imul(L, td)) | 0; f = (f + Math.imul(j, tg)) | 0; u = (u + Math.imul(j, tb)) | 0; u = (u + Math.imul(P, tg)) | 0; c = (c + Math.imul(P, tb)) | 0; var tj = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tj >>> 26)) | 0; tj &= 0x3ffffff; f = Math.imul(D, th); u = Math.imul(D, td); u = (u + Math.imul($, th)) | 0; c = Math.imul($, td); f = (f + Math.imul(B, tg)) | 0; u = (u + Math.imul(B, tb)) | 0; u = (u + Math.imul(L, tg)) | 0; c = (c + Math.imul(L, tb)) | 0; var tP = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tP >>> 26)) | 0; tP &= 0x3ffffff; f = Math.imul(D, tg); u = Math.imul(D, tb); u = (u + Math.imul($, tg)) | 0; c = Math.imul($, tb); var tC = (((a + f) | 0) + ((u & 0x1fff) << 13)) | 0; a = (((c + (u >>> 13)) | 0) + (tC >>> 26)) | 0; tC &= 0x3ffffff; s[0] = tv; s[1] = ty; s[2] = tm; s[3] = tw; s[4] = t_; s[5] = tS; s[6] = tE; s[7] = tx; s[8] = tM; s[9] = tT; s[10] = tA; s[11] = tO; s[12] = tk; s[13] = tI; s[14] = tR; s[15] = tN; s[16] = tj; s[17] = tP; s[18] = tC; if (a !== 0) { s[19] = a; n.length++; } return n; }; if (!Math.imul) { b = g; } function v(t, e, r) { r.negative = e.negative ^ t.negative; r.length = t.length + e.length; var n = 0; var i = 0; for(var o = 0; o < r.length - 1; o++){ var s = i; i = 0; var a = n & 0x3ffffff; var f = Math.min(o, e.length - 1); for(var u = Math.max(0, o - t.length + 1); u <= f; u++){ var c = o - u; var l = t.words[c] | 0; var h = e.words[u] | 0; var d = l * h; var p = d & 0x3ffffff; s = (s + ((d / 0x4000000) | 0)) | 0; p = (p + a) | 0; a = p & 0x3ffffff; s = (s + (p >>> 26)) | 0; i += s >>> 26; s &= 0x3ffffff; } r.words[o] = a; n = s; s = i; } if (n !== 0) { r.words[o] = n; } else { r.length--; } return r.strip(); } function y(t, e, r) { var n = new m(); return n.mulp(t, e, r); } o.prototype.mulTo = function t(e, r) { var n; var i = this.length + e.length; if (this.length === 10 && e.length === 10) { n = b(this, e, r); } else if (i < 63) { n = g(this, e, r); } else if (i < 1024) { n = v(this, e, r); } else { n = y(this, e, r); } return n; }; function m(t, e) { this.x = t; this.y = e; } m.prototype.makeRBT = function t(e) { var r = new Array(e); var n = o.prototype._countBits(e) - 1; for(var i = 0; i < e; i++){ r[i] = this.revBin(i, n, e); } return r; }; m.prototype.revBin = function t(e, r, n) { if (e === 0 || e === n - 1) return e; var i = 0; for(var o = 0; o < r; o++){ i |= (e & 1) << (r - o - 1); e >>= 1; } return i; }; m.prototype.permute = function t(e, r, n, i, o, s) { for(var a = 0; a < s; a++){ i[a] = r[e[a]]; o[a] = n[e[a]]; } }; m.prototype.transform = function t(e, r, n, i, o, s) { this.permute(s, e, r, n, i, o); for(var a = 1; a < o; a <<= 1){ var f = a << 1; var u = Math.cos(2 * Math.PI / f); var c = Math.sin(2 * Math.PI / f); for(var l = 0; l < o; l += f){ var h = u; var d = c; for(var p = 0; p < a; p++){ var g = n[l + p]; var b = i[l + p]; var v = n[l + p + a]; var y = i[l + p + a]; var m = h * v - d * y; y = h * y + d * v; v = m; n[l + p] = g + v; i[l + p] = b + y; n[l + p + a] = g - v; i[l + p + a] = b - y; if (p !== f) { m = u * h - c * d; d = u * d + c * h; h = m; } } } } }; m.prototype.guessLen13b = function t(e, r) { var n = Math.max(r, e) | 1; var i = n & 1; var o = 0; for(n = n / 2 | 0; n; n = n >>> 1){ o++; } return 1 << o + 1 + i; }; m.prototype.conjugate = function t(e, r, n) { if (n <= 1) return; for(var i = 0; i < n / 2; i++){ var o = e[i]; e[i] = e[n - i - 1]; e[n - i - 1] = o; o = r[i]; r[i] = -r[n - i - 1]; r[n - i - 1] = -o; } }; m.prototype.normalize13b = function t(e, r) { var n = 0; for(var i = 0; i < r / 2; i++){ var o = Math.round(e[2 * i + 1] / r) * 0x2000 + Math.round(e[2 * i] / r) + n; e[i] = o & 0x3ffffff; if (o < 0x4000000) { n = 0; } else { n = o / 0x4000000 | 0; } } return e; }; m.prototype.convert13b = function t(e, r, i, o) { var s = 0; for(var a = 0; a < r; a++){ s = s + (e[a] | 0); i[2 * a] = s & 0x1fff; s = s >>> 13; i[2 * a + 1] = s & 0x1fff; s = s >>> 13; } for(a = 2 * r; a < o; ++a){ i[a] = 0; } n(s === 0); n((s & ~0x1fff) === 0); }; m.prototype.stub = function t(e) { var r = new Array(e); for(var n = 0; n < e; n++){ r[n] = 0; } return r; }; m.prototype.mulp = function t(e, r, n) { var i = 2 * this.guessLen13b(e.length, r.length); var o = this.makeRBT(i); var s = this.stub(i); var a = new Array(i); var f = new Array(i); var u = new Array(i); var c = new Array(i); var l = new Array(i); var h = new Array(i); var d = n.words; d.length = i; this.convert13b(e.words, e.length, a, i); this.convert13b(r.words, r.length, c, i); this.transform(a, s, f, u, i, o); this.transform(c, s, l, h, i, o); for(var p = 0; p < i; p++){ var g = f[p] * l[p] - u[p] * h[p]; u[p] = f[p] * h[p] + u[p] * l[p]; f[p] = g; } this.conjugate(f, u, i); this.transform(f, u, d, s, i, o); this.conjugate(d, s, i); this.normalize13b(d, i); n.negative = e.negative ^ r.negative; n.length = e.length + r.length; return n.strip(); }; o.prototype.mul = function t(e) { var r = new o(null); r.words = new Array(this.length + e.length); return this.mulTo(e, r); }; o.prototype.mulf = function t(e) { var r = new o(null); r.words = new Array(this.length + e.length); return y(this, e, r); }; o.prototype.imul = function t(e) { return this.clone().mulTo(e, this); }; o.prototype.imuln = function t(e) { n(typeof e === 'number'); n(e < 0x4000000); var r = 0; for(var i = 0; i < this.length; i++){ var o = (this.words[i] | 0) * e; var s = (o & 0x3ffffff) + (r & 0x3ffffff); r >>= 26; r += (o / 0x4000000) | 0; r += s >>> 26; this.words[i] = s & 0x3ffffff; } if (r !== 0) { this.words[i] = r; this.length++; } return this; }; o.prototype.muln = function t(e) { return this.clone().imuln(e); }; o.prototype.sqr = function t() { return this.mul(this); }; o.prototype.isqr = function t() { return this.imul(this.clone()); }; o.prototype.pow = function t(e) { var r = p(e); if (r.length === 0) return new o(1); var n = this; for(var i = 0; i < r.length; i++, n = n.sqr()){ if (r[i] !== 0) break; } if (++i < r.length) { for(var s = n.sqr(); i < r.length; i++, s = s.sqr()){ if (r[i] === 0) continue; n = n.mul(s); } } return n; }; o.prototype.iushln = function t(e) { n(typeof e === 'number' && e >= 0); var r = e % 26; var i = (e - r) / 26; var o = (0x3ffffff >>> (26 - r)) << (26 - r); var s; if (r !== 0) { var a = 0; for(s = 0; s < this.length; s++){ var f = this.words[s] & o; var u = ((this.words[s] | 0) - f) << r; this.words[s] = u | a; a = f >>> (26 - r); } if (a) { this.words[s] = a; this.length++; } } if (i !== 0) { for(s = this.length - 1; s >= 0; s--){ this.words[s + i] = this.words[s]; } for(s = 0; s < i; s++){ this.words[s] = 0; } this.length += i; } return this.strip(); }; o.prototype.ishln = function t(e) { n(this.negative === 0); return this.iushln(e); }; o.prototype.iushrn = function t(e, r, i) { n(typeof e === 'number' && e >= 0); var o; if (r) { o = (r - (r % 26)) / 26; } else { o = 0; } var s = e % 26; var a = Math.min((e - s) / 26, this.length); var f = 0x3ffffff ^ ((0x3ffffff >>> s) << s); var u = i; o -= a; o = Math.max(0, o); if (u) { for(var c = 0; c < a; c++){ u.words[c] = this.words[c]; } u.length = a; } if (a === 0) {} else if (this.length > a) { this.length -= a; for(c = 0; c < this.length; c++){ this.words[c] = this.words[c + a]; } } else { this.words[0] = 0; this.length = 1; } var l = 0; for(c = this.length - 1; c >= 0 && (l !== 0 || c >= o); c--){ var h = this.words[c] | 0; this.words[c] = (l << (26 - s)) | (h >>> s); l = h & f; } if (u && l !== 0) { u.words[u.length++] = l; } if (this.length === 0) { this.words[0] = 0; this.length = 1; } return this.strip(); }; o.prototype.ishrn = function t(e, r, i) { n(this.negative === 0); return this.iushrn(e, r, i); }; o.prototype.shln = function t(e) { return this.clone().ishln(e); }; o.prototype.ushln = function t(e) { return this.clone().iushln(e); }; o.prototype.shrn = function t(e) { return this.clone().ishrn(e); }; o.prototype.ushrn = function t(e) { return this.clone().iushrn(e); }; o.prototype.testn = function t(e) { n(typeof e === 'number' && e >= 0); var r = e % 26; var i = (e - r) / 26; var o = 1 << r; if (this.length <= i) return false; var s = this.words[i]; return !!(s & o); }; o.prototype.imaskn = function t(e) { n(typeof e === 'number' && e >= 0); var r = e % 26; var i = (e - r) / 26; n(this.negative === 0, 'imaskn works only with positive numbers'); if (this.length <= i) { return this; } if (r !== 0) { i++; } this.length = Math.min(i, this.length); if (r !== 0) { var o = 0x3ffffff ^ ((0x3ffffff >>> r) << r); this.words[this.length - 1] &= o; } return this.strip(); }; o.prototype.maskn = function t(e) { return this.clone().imaskn(e); }; o.prototype.iaddn = function t(e) { n(typeof e === 'number'); n(e < 0x4000000); if (e < 0) return this.isubn(-e); if (this.negative !== 0) { if (this.length === 1 && (this.words[0] | 0) < e) { this.words[0] = e - (this.words[0] | 0); this.negative = 0; return this; } this.negative = 0; this.isubn(e); this.negative = 1; return this; } return this._iaddn(e); }; o.prototype._iaddn = function t(e) { this.words[0] += e; for(var r = 0; r < this.length && this.words[r] >= 0x4000000; r++){ this.words[r] -= 0x4000000; if (r === this.length - 1) { this.words[r + 1] = 1; } else { this.words[r + 1]++; } } this.length = Math.max(this.length, r + 1); return this; }; o.prototype.isubn = function t(e) { n(typeof e === 'number'); n(e < 0x4000000); if (e < 0) return this.iaddn(-e); if (this.negative !== 0) { this.negative = 0; this.iaddn(e); this.negative = 1; return this; } this.words[0] -= e; if (this.length === 1 && this.words[0] < 0) { this.words[0] = -this.words[0]; this.negative = 1; } else { for(var r = 0; r < this.length && this.words[r] < 0; r++){ this.words[r] += 0x4000000; this.words[r + 1] -= 1; } } return this.strip(); }; o.prototype.addn = function t(e) { return this.clone().iaddn(e); }; o.prototype.subn = function t(e) { return this.clone().isubn(e); }; o.prototype.iabs = function t() { this.negative = 0; return this; }; o.prototype.abs = function t() { return this.clone().iabs(); }; o.prototype._ishlnsubmul = function t(e, r, i) { var o = e.length + i; var s; this._expand(o); var a; var f = 0; for(s = 0; s < e.length; s++){ a = (this.words[s + i] | 0) + f; var u = (e.words[s] | 0) * r; a -= u & 0x3ffffff; f = (a >> 26) - ((u / 0x4000000) | 0); this.words[s + i] = a & 0x3ffffff; } for(; s < this.length - i; s++){ a = (this.words[s + i] | 0) + f; f = a >> 26; this.words[s + i] = a & 0x3ffffff; } if (f === 0) return this.strip(); n(f === -1); f = 0; for(s = 0; s < this.length; s++){ a = -(this.words[s] | 0) + f; f = a >> 26; this.words[s] = a & 0x3ffffff; } this.negative = 1; return this.strip(); }; o.prototype._wordDiv = function t(e, r) { var n = this.length - e.length; var i = this.clone(); var s = e; var a = s.words[s.length - 1] | 0; var f = this._countBits(a); n = 26 - f; if (n !== 0) { s = s.ushln(n); i.iushln(n); a = s.words[s.length - 1] | 0; } var u = i.length - s.length; var c; if (r !== 'mod') { c = new o(null); c.length = u + 1; c.words = new Array(c.length); for(var l = 0; l < c.length; l++){ c.words[l] = 0; } } var h = i.clone()._ishlnsubmul(s, 1, u); if (h.negative === 0) { i = h; if (c) { c.words[u] = 1; } } for(var d = u - 1; d >= 0; d--){ var p = (i.words[s.length + d] | 0) * 0x4000000 + (i.words[s.length + d - 1] | 0); p = Math.min((p / a) | 0, 0x3ffffff); i._ishlnsubmul(s, p, d); while(i.negative !== 0){ p--; i.negative = 0; i._ishlnsubmul(s, 1, d); if (!i.isZero()) { i.negative ^= 1; } } if (c) { c.words[d] = p; } } if (c) { c.strip(); } i.strip(); if (r !== 'div' && n !== 0) { i.iushrn(n); } return { div: c || null, mod: i }; }; o.prototype.divmod = function t(e, r, i) { n(!e.isZero()); if (this.isZero()) { return { div: new o(0), mod: new o(0) }; } var s, a, f; if (this.negative !== 0 && e.negative === 0) { f = this.neg().divmod(e, r); if (r !== 'mod') { s = f.div.neg(); } if (r !== 'div') { a = f.mod.neg(); if (i && a.negative !== 0) { a.iadd(e); } } return { div: s, mod: a }; } if (this.negative === 0 && e.negative !== 0) { f = this.divmod(e.neg(), r); if (r !== 'mod') { s = f.div.neg(); } return { div: s, mod: f.mod }; } if ((this.negative & e.negative) !== 0) { f = this.neg().divmod(e.neg(), r); if (r !== 'div') { a = f.mod.neg(); if (i && a.negative !== 0) { a.isub(e); } } return { div: f.div, mod: a }; } if (e.length > this.length || this.cmp(e) < 0) { return { div: new o(0), mod: this }; } if (e.length === 1) { if (r === 'div') { return { div: this.divn(e.words[0]), mod: null }; } if (r === 'mod') { return { div: null, mod: new o(this.modn(e.words[0])) }; } return { div: this.divn(e.words[0]), mod: new o(this.modn(e.words[0])) }; } return this._wordDiv(e, r); }; o.prototype.div = function t(e) { return this.divmod(e, 'div', false).div; }; o.prototype.mod = function t(e) { return this.divmod(e, 'mod', false).mod; }; o.prototype.umod = function t(e) { return this.divmod(e, 'mod', true).mod; }; o.prototype.divRound = function t(e) { var r = this.divmod(e); if (r.mod.isZero()) return r.div; var n = r.div.negative !== 0 ? r.mod.isub(e) : r.mod; var i = e.ushrn(1); var o = e.andln(1); var s = n.cmp(i); if (s < 0 || o === 1 && s === 0) return r.div; return r.div.negative !== 0 ? r.div.isubn(1) : r.div.iaddn(1); }; o.prototype.modn = function t(e) { n(e <= 0x3ffffff); var r = (1 << 26) % e; var i = 0; for(var o = this.length - 1; o >= 0; o--){ i = (r * i + (this.words[o] | 0)) % e; } return i; }; o.prototype.idivn = function t(e) { n(e <= 0x3ffffff); var r = 0; for(var i = this.length - 1; i >= 0; i--){ var o = (this.words[i] | 0) + r * 0x4000000; this.words[i] = (o / e) | 0; r = o % e; } return this.strip(); }; o.prototype.divn = function t(e) { return this.clone().idivn(e); }; o.prototype.egcd = function t(e) { n(e.negative === 0); n(!e.isZero()); var r = this; var i = e.clone(); if (r.negative !== 0) { r = r.umod(e); } else { r = r.clone(); } var s = new o(1); var a = new o(0); var f = new o(0); var u = new o(1); var c = 0; while(r.isEven() && i.isEven()){ r.iushrn(1); i.iushrn(1); ++c; } var l = i.clone(); var h = r.clone(); while(!r.isZero()){ for(var d = 0, p = 1; (r.words[0] & p) === 0 && d < 26; ++d, p <<= 1); if (d > 0) { r.iushrn(d); while(d-- > 0){ if (s.isOdd() || a.isOdd()) { s.iadd(l); a.isub(h); } s.iushrn(1); a.iushrn(1); } } for(var g = 0, b = 1; (i.words[0] & b) === 0 && g < 26; ++g, b <<= 1); if (g > 0) { i.iushrn(g); while(g-- > 0){ if (f.isOdd() || u.isOdd()) { f.iadd(l); u.isub(h); } f.iushrn(1); u.iushrn(1); } } if (r.cmp(i) >= 0) { r.isub(i); s.isub(f); a.isub(u); } else { i.isub(r); f.isub(s); u.isub(a); } } return { a: f, b: u, gcd: i.iushln(c) }; }; o.prototype._invmp = function t(e) { n(e.negative === 0); n(!e.isZero()); var r = this; var i = e.clone(); if (r.negative !== 0) { r = r.umod(e); } else { r = r.clone(); } var s = new o(1); var a = new o(0); var f = i.clone(); while(r.cmpn(1) > 0 && i.cmpn(1) > 0){ for(var u = 0, c = 1; (r.words[0] & c) === 0 && u < 26; ++u, c <<= 1); if (u > 0) { r.iushrn(u); while(u-- > 0){ if (s.isOdd()) { s.iadd(f); } s.iushrn(1); } } for(var l = 0, h = 1; (i.words[0] & h) === 0 && l < 26; ++l, h <<= 1); if (l > 0) { i.iushrn(l); while(l-- > 0){ if (a.isOdd()) { a.iadd(f); } a.iushrn(1); } } if (r.cmp(i) >= 0) { r.isub(i); s.isub(a); } else { i.isub(r); a.isub(s); } } var d; if (r.cmpn(1) === 0) { d = s; } else { d = a; } if (d.cmpn(0) < 0) { d.iadd(e); } return d; }; o.prototype.gcd = function t(e) { if (this.isZero()) return e.abs(); if (e.isZero()) return this.abs(); var r = this.clone(); var n = e.clone(); r.negative = 0; n.negative = 0; for(var i = 0; r.isEven() && n.isEven(); i++){ r.iushrn(1); n.iushrn(1); } do { while(r.isEven()){ r.iushrn(1); } while(n.isEven()){ n.iushrn(1); } var o = r.cmp(n); if (o < 0) { var s = r; r = n; n = s; } else if (o === 0 || n.cmpn(1) === 0) { break; } r.isub(n); }while (true) return n.iushln(i); }; o.prototype.invm = function t(e) { return this.egcd(e).a.umod(e); }; o.prototype.isEven = function t() { return (this.words[0] & 1) === 0; }; o.prototype.isOdd = function t() { return (this.words[0] & 1) === 1; }; o.prototype.andln = function t(e) { return this.words[0] & e; }; o.prototype.bincn = function t(e) { n(typeof e === 'number'); var r = e % 26; var i = (e - r) / 26; var o = 1 << r; if (this.length <= i) { this._expand(i + 1); this.words[i] |= o; return this; } var s = o; for(var a = i; s !== 0 && a < this.length; a++){ var f = this.words[a] | 0; f += s; s = f >>> 26; f &= 0x3ffffff; this.words[a] = f; } if (s !== 0) { this.words[a] = s; this.length++; } return this; }; o.prototype.isZero = function t() { return this.length === 1 && this.words[0] === 0; }; o.prototype.cmpn = function t(e) { var r = e < 0; if (this.negative !== 0 && !r) return -1; if (this.negative === 0 && r) return 1; this.strip(); var i; if (this.length > 1) { i = 1; } else { if (r) { e = -e; } n(e <= 0x3ffffff, 'Number is too big'); var o = this.words[0] | 0; i = o === e ? 0 : o < e ? -1 : 1; } if (this.negative !== 0) return -i | 0; return i; }; o.prototype.cmp = function t(e) { if (this.negative !== 0 && e.negative === 0) return -1; if (this.negative === 0 && e.negative !== 0) return 1; var r = this.ucmp(e); if (this.negative !== 0) return -r | 0; return r; }; o.prototype.ucmp = function t(e) { if (this.length > e.length) return 1; if (this.length < e.length) return -1; var r = 0; for(var n = this.length - 1; n >= 0; n--){ var i = this.words[n] | 0; var o = e.words[n] | 0; if (i === o) continue; if (i < o) { r = -1; } else if (i > o) { r = 1; } break; } return r; }; o.prototype.gtn = function t(e) { return this.cmpn(e) === 1; }; o.prototype.gt = function t(e) { return this.cmp(e) === 1; }; o.prototype.gten = function t(e) { return this.cmpn(e) >= 0; }; o.prototype.gte = function t(e) { return this.cmp(e) >= 0; }; o.prototype.ltn = function t(e) { return this.cmpn(e) === -1; }; o.prototype.lt = function t(e) { return this.cmp(e) === -1; }; o.prototype.lten = function t(e) { return this.cmpn(e) <= 0; }; o.prototype.lte = function t(e) { return this.cmp(e) <= 0; }; o.prototype.eqn = function t(e) { return this.cmpn(e) === 0; }; o.prototype.eq = function t(e) { return this.cmp(e) === 0; }; o.red = function t(e) { return new T(e); }; o.prototype.toRed = function t(e) { n(!this.red, 'Already a number in reduction context'); n(this.negative === 0, 'red works only with positives'); return e.convertTo(this)._forceRed(e); }; o.prototype.fromRed = function t() { n(this.red, 'fromRed works only with numbers in reduction context'); return this.red.convertFrom(this); }; o.prototype._forceRed = function t(e) { this.red = e; return this; }; o.prototype.forceRed = function t(e) { n(!this.red, 'Already a number in reduction context'); return this._forceRed(e); }; o.prototype.redAdd = function t(e) { n(this.red, 'redAdd works only with red numbers'); return this.red.add(this, e); }; o.prototype.redIAdd = function t(e) { n(this.red, 'redIAdd works only with red numbers'); return this.red.iadd(this, e); }; o.prototype.redSub = function t(e) { n(this.red, 'redSub works only with red numbers'); return this.red.sub(this, e); }; o.prototype.redISub = function t(e) { n(this.red, 'redISub works only with red numbers'); return this.red.isub(this, e); }; o.prototype.redShl = function t(e) { n(this.red, 'redShl works only with red numbers'); return this.red.shl(this, e); }; o.prototype.redMul = function t(e) { n(this.red, 'redMul works only with red numbers'); this.red._verify2(this, e); return this.red.mul(this, e); }; o.prototype.redIMul = function t(e) { n(this.red, 'redMul works only with red numbers'); this.red._verify2(this, e); return this.red.imul(this, e); }; o.prototype.redSqr = function t() { n(this.red, 'redSqr works only with red numbers'); this.red._verify1(this); return this.red.sqr(this); }; o.prototype.redISqr = function t() { n(this.red, 'redISqr works only with red numbers'); this.red._verify1(this); return this.red.isqr(this); }; o.prototype.redSqrt = function t() { n(this.red, 'redSqrt works only with red numbers'); this.red._verify1(this); return this.red.sqrt(this); }; o.prototype.redInvm = function t() { n(this.red, 'redInvm works only with red numbers'); this.red._verify1(this); return this.red.invm(this); }; o.prototype.redNeg = function t() { n(this.red, 'redNeg works only with red numbers'); this.red._verify1(this); return this.red.neg(this); }; o.prototype.redPow = function t(e) { n(this.red && !e.red, 'redPow(normalNum)'); this.red._verify1(this); return this.red.pow(this, e); }; var w = { k256: null, p224: null, p192: null, p25519: null }; function _(t, e) { this.name = t; this.p = new o(e, 16); this.n = this.p.bitLength(); this.k = new o(1).iushln(this.n).isub(this.p); this.tmp = this._tmp(); } _.prototype._tmp = function t() { var e = new o(null); e.words = new Array(Math.ceil(this.n / 13)); return e; }; _.prototype.ireduce = function t(e) { var r = e; var n; do { this.split(r, this.tmp); r = this.imulK(r); r = r.iadd(this.tmp); n = r.bitLength(); }while (n > this.n) var i = n < this.n ? -1 : r.ucmp(this.p); if (i === 0) { r.words[0] = 0; r.length = 1; } else if (i > 0) { r.isub(this.p); } else { if (r.strip !== undefined) { r.strip(); } else { r._strip(); } } return r; }; _.prototype.split = function t(e, r) { e.iushrn(this.n, 0, r); }; _.prototype.imulK = function t(e) { return e.imul(this.k); }; function S() { _.call(this, 'k256', 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f'); } i(S, _); S.prototype.split = function t(e, r) { var n = 0x3fffff; var i = Math.min(e.length, 9); for(var o = 0; o < i; o++){ r.words[o] = e.words[o]; } r.length = i; if (e.length <= 9) { e.words[0] = 0; e.length = 1; return; } var s = e.words[9]; r.words[r.length++] = s & n; for(o = 10; o < e.length; o++){ var a = e.words[o] | 0; e.words[o - 10] = ((a & n) << 4) | (s >>> 22); s = a; } s >>>= 22; e.words[o - 10] = s; if (s === 0 && e.length > 10) { e.length -= 10; } else { e.length -= 9; } }; S.prototype.imulK = function t(e) { e.words[e.length] = 0; e.words[e.length + 1] = 0; e.length += 2; var r = 0; for(var n = 0; n < e.length; n++){ var i = e.words[n] | 0; r += i * 0x3d1; e.words[n] = r & 0x3ffffff; r = i * 0x40 + ((r / 0x4000000) | 0); } if (e.words[e.length - 1] === 0) { e.length--; if (e.words[e.length - 1] === 0) { e.length--; } } return e; }; function E() { _.call(this, 'p224', 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001'); } i(E, _); function x() { _.call(this, 'p192', 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff'); } i(x, _); function M() { _.call(this, '25519', '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed'); } i(M, _); M.prototype.imulK = function t(e) { var r = 0; for(var n = 0; n < e.length; n++){ var i = (e.words[n] | 0) * 0x13 + r; var o = i & 0x3ffffff; i >>>= 26; e.words[n] = o; r = i; } if (r !== 0) { e.words[e.length++] = r; } return e; }; o._prime = function t(e) { if (w[e]) return w[e]; var r; if (e === 'k256') { r = new S(); } else if (e === 'p224') { r = new E(); } else if (e === 'p192') { r = new x(); } else if (e === 'p25519') { r = new M(); } else { throw new Error('Unknown prime ' + e); } w[e] = r; return r; }; function T(t) { if (typeof t === 'string') { var e = o._prime(t); this.m = e.p; this.prime = e; } else { n(t.gtn(1), 'modulus must be greater than 1'); this.m = t; this.prime = null; } } T.prototype._verify1 = function t(e) { n(e.negative === 0, 'red works only with positives'); n(e.red, 'red works only with red numbers'); }; T.prototype._verify2 = function t(e, r) { n((e.negative | r.negative) === 0, 'red works only with positives'); n(e.red && e.red === r.red, 'red works only with red numbers'); }; T.prototype.imod = function t(e) { if (this.prime) return this.prime.ireduce(e)._forceRed(this); return e.umod(this.m)._forceRed(this); }; T.prototype.neg = function t(e) { if (e.isZero()) { return e.clone(); } return this.m.sub(e)._forceRed(this); }; T.prototype.add = function t(e, r) { this._verify2(e, r); var n = e.add(r); if (n.cmp(this.m) >= 0) { n.isub(this.m); } return n._forceRed(this); }; T.prototype.iadd = function t(e, r) { this._verify2(e, r); var n = e.iadd(r); if (n.cmp(this.m) >= 0) { n.isub(this.m); } return n; }; T.prototype.sub = function t(e, r) { this._verify2(e, r); var n = e.sub(r); if (n.cmpn(0) < 0) { n.iadd(this.m); } return n._forceRed(this); }; T.prototype.isub = function t(e, r) { this._verify2(e, r); var n = e.isub(r); if (n.cmpn(0) < 0) { n.iadd(this.m); } return n; }; T.prototype.shl = function t(e, r) { this._verify1(e); return this.imod(e.ushln(r)); }; T.prototype.imul = function t(e, r) { this._verify2(e, r); return this.imod(e.imul(r)); }; T.prototype.mul = function t(e, r) { this._verify2(e, r); return this.imod(e.mul(r)); }; T.prototype.isqr = function t(e) { return this.imul(e, e.clone()); }; T.prototype.sqr = function t(e) { return this.mul(e, e); }; T.prototype.sqrt = function t(e) { if (e.isZero()) return e.clone(); var r = this.m.andln(3); n(r % 2 === 1); if (r === 3) { var i = this.m.add(new o(1)).iushrn(2); return this.pow(e, i); } var s = this.m.subn(1); var a = 0; while(!s.isZero() && s.andln(1) === 0){ a++; s.iushrn(1); } n(!s.isZero()); var f = new o(1).toRed(this); var u = f.redNeg(); var c = this.m.subn(1).iushrn(1); var l = this.m.bitLength(); l = new o(2 * l * l).toRed(this); while(this.pow(l, c).cmp(u) !== 0){ l.redIAdd(u); } var h = this.pow(l, s); var d = this.pow(e, s.addn(1).iushrn(1)); var p = this.pow(e, s); var g = a; while(p.cmp(f) !== 0){ var b = p; for(var v = 0; b.cmp(f) !== 0; v++){ b = b.redSqr(); } n(v < g); var y = this.pow(h, new o(1).iushln(g - v - 1)); d = d.redMul(y); h = y.redSqr(); p = p.redMul(h); g = v; } return d; }; T.prototype.invm = function t(e) { var r = e._invmp(this.m); if (r.negative !== 0) { r.negative = 0; return this.imod(r).redNeg(); } else { return this.imod(r); } }; T.prototype.pow = function t(e, r) { if (r.isZero()) return new o(1).toRed(this); if (r.cmpn(1) === 0) return e.clone(); var n = 4; var i = new Array(1 << n); i[0] = new o(1).toRed(this); i[1] = e; for(var s = 2; s < i.length; s++){ i[s] = this.mul(i[s - 1], e); } var a = i[0]; var f = 0; var u = 0; var c = r.bitLength() % 26; if (c === 0) { c = 26; } for(s = r.length - 1; s >= 0; s--){ var l = r.words[s]; for(var h = c - 1; h >= 0; h--){ var d = (l >> h) & 1; if (a !== i[0]) { a = this.sqr(a); } if (d === 0 && f === 0) { u = 0; continue; } f <<= 1; f |= d; u++; if (u !== n && (s !== 0 || h !== 0)) continue; a = this.mul(a, i[f]); u = 0; f = 0; } c = 26; } return a; }; T.prototype.convertTo = function t(e) { var r = e.umod(this.m); return r === e ? r.clone() : r; }; T.prototype.convertFrom = function t(e) { var r = e.clone(); r.red = null; return r; }; o.mont = function t(e) { return new A(e); }; function A(t) { T.call(this, t); this.shift = this.m.bitLength(); if (this.shift % 26 !== 0) { this.shift += 26 - (this.shift % 26); } this.r = new o(1).iushln(this.shift); this.r2 = this.imod(this.r.sqr()); this.rinv = this.r._invmp(this.m); this.minv = this.rinv.mul(this.r).isubn(1).div(this.m); this.minv = this.minv.umod(this.r); this.minv = this.r.sub(this.minv); } i(A, T); A.prototype.convertTo = function t(e) { return this.imod(e.ushln(this.shift)); }; A.prototype.convertFrom = function t(e) { var r = this.imod(e.mul(this.rinv)); r.red = null; return r; }; A.prototype.imul = function t(e, r) { if (e.isZero() || r.isZero()) { e.words[0] = 0; e.length = 1; return e; } var n = e.imul(r); var i = n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); var o = n.isub(i).iushrn(this.shift); var s = o; if (o.cmp(this.m) >= 0) { s = o.isub(this.m); } else if (o.cmpn(0) < 0) { s = o.iadd(this.m); } return s._forceRed(this); }; A.prototype.mul = function t(e, r) { if (e.isZero() || r.isZero()) return new o(0)._forceRed(this); var n = e.mul(r); var i = n.maskn(this.shift).mul(this.minv).imaskn(this.shift).mul(this.m); var s = n.isub(i).iushrn(this.shift); var a = s; if (s.cmp(this.m) >= 0) { a = s.isub(this.m); } else if (s.cmpn(0) < 0) { a = s.iadd(this.m); } return a._forceRed(this); }; A.prototype.invm = function t(e) { var r = this.imod(e._invmp(this.m).mul(this.r2)); return r._forceRed(this); }; })(false || t, this); }), 9931: (function(t, e, r) { var n; t.exports = function t(e) { if (!n) n = new i(null); return n.generate(e); }; function i(t) { this.rand = t; } t.exports.Rand = i; i.prototype.generate = function t(e) { return this._rand(e); }; i.prototype._rand = function t(e) { if (this.rand.getBytes) return this.rand.getBytes(e); var r = new Uint8Array(e); for(var n = 0; n < r.length; n++)r[n] = this.rand.getByte(); return r; }; if (typeof self === 'object') { if (self.crypto && self.crypto.getRandomValues) { i.prototype._rand = function t(e) { var r = new Uint8Array(e); self.crypto.getRandomValues(r); return r; }; } else if (self.msCrypto && self.msCrypto.getRandomValues) { i.prototype._rand = function t(e) { var r = new Uint8Array(e); self.msCrypto.getRandomValues(r); return r; }; } else if (typeof window === 'object') { i.prototype._rand = function() { throw new Error('Not implemented yet'); }; } } else { try { var o = r(9214); if (typeof o.randomBytes !== 'function') throw new Error('Not supported'); i.prototype._rand = function t(e) { return o.randomBytes(e); }; } catch (s) {} } }), 1708: (function(t, e, r) { "use strict"; const { AbstractLevel: n } = r(875); const i = r(4473); const o = r(9967); const { fromCallback: s } = r(6957); const { Iterator: a } = r(8212); const f = r(9687); const u = r(7753); const c = r(1217); const l = 'level-js-'; const h = Symbol('idb'); const d = Symbol('namePrefix'); const p = Symbol('location'); const g = Symbol('version'); const b = Symbol('store'); const v = Symbol('onComplete'); const y = Symbol('promise'); class m extends n { constructor(t, e, r){ if (typeof e === 'function' || typeof r === 'function') { throw new i('The levelup-style callback argument has been removed', { code: 'LEVEL_LEGACY' }); } const { prefix: n , version: o , ...s } = e || {}; super({ encodings: { view: true }, snapshots: false, createIfMissing: false, errorIfExists: false, seek: true }, s); if (typeof t !== 'string') { throw new Error('constructor requires a location string argument'); } this[p] = t; this[d] = n == null ? l : n; this[g] = parseInt(o || 1, 10); this[h] = null; } get location() { return this[p]; } get namePrefix() { return this[d]; } get version() { return this[g]; } get db() { return this[h]; } get type() { return 'browser-level'; } _open(t, e) { const r = indexedDB.open(this[d] + this[p], this[g]); r.onerror = function() { e(r.error || new Error('unknown error')); }; r.onsuccess = ()=>{ this[h] = r.result; e(); }; r.onupgradeneeded = (t)=>{ const e = t.target.result; if (!e.objectStoreNames.contains(this[p])) { e.createObjectStore(this[p]); } }; } [b](t) { const e = this[h].transaction([ this[p] ], t); return e.objectStore(this[p]); } [v](t, e) { const r = t.transaction; r.onabort = function() { e(r.error || new Error('aborted by user')); }; r.oncomplete = function() { e(null, t.result); }; } _get(t, e, r) { const n = this[b]('readonly'); let o; try { o = n.get(t); } catch (s) { return this.nextTick(r, s); } this[v](o, function(t, e) { if (t) return r(t); if (e === undefined) { return r(new i('Entry not found', { code: 'LEVEL_NOT_FOUND' })); } r(null, f(e)); }); } _getMany(t, e, r) { const n = this[b]('readonly'); const i = t.map((t)=>(e)=>{ let r; try { r = n.get(t); } catch (i) { return e(i); } r.onsuccess = ()=>{ const t = r.result; e(null, t === undefined ? t : f(t)); }; r.onerror = (t)=>{ t.stopPropagation(); e(r.error); }; }); o(i, 16, r); } _del(t, e, r) { const n = this[b]('readwrite'); let i; try { i = n.delete(t); } catch (o) { return this.nextTick(r, o); } this[v](i, r); } _put(t, e, r, n) { const i = this[b]('readwrite'); let o; try { o = i.put(e, t); } catch (s) { return this.nextTick(n, s); } this[v](o, n); } _iterator(t) { return new a(this, this[p], t); } _batch(t, e, r) { const n = this[b]('readwrite'); const i = n.transaction; let o = 0; let s; i.onabort = function() { r(s || i.error || new Error('aborted by user')); }; i.oncomplete = function() { r(); }; function a() { const e = t[o++]; const r = e.key; let f; try { f = e.type === 'del' ? n.delete(r) : n.put(e.value, r); } catch (u) { s = u; i.abort(); return; } if (o < t.length) { f.onsuccess = a; } else if (typeof i.commit === 'function') { i.commit(); } } a(); } _clear(t, e) { let r; let n; try { r = c(t); } catch (i) { return this.nextTick(e); } if (t.limit >= 0) { return u(this, this[p], r, t, e); } try { const o = this[b]('readwrite'); n = r ? o.delete(r) : o.clear(); } catch (s) { return this.nextTick(e, s); } this[v](n, e); } _close(t) { this[h].close(); this.nextTick(t); } } m.destroy = function(t, e, r) { if (typeof e === 'function') { r = e; e = l; } r = s(r, y); const n = indexedDB.deleteDatabase(e + t); n.onsuccess = function() { r(); }; n.onerror = function(t) { r(t); }; return r[y]; }; e.BrowserLevel = m; }), 8212: (function(t, e, r) { "use strict"; const { AbstractIterator: n } = r(875); const i = r(1217); const o = r(9687); const s = Symbol('cache'); const a = Symbol('finished'); const f = Symbol('options'); const u = Symbol('currentOptions'); const c = Symbol('position'); const l = Symbol('location'); const h = Symbol('first'); const d = {}; class p extends n { constructor(t, e, r){ super(t, r); this[s] = []; this[a] = this.limit === 0; this[f] = r; this[u] = { ...r }; this[c] = undefined; this[l] = e; this[h] = true; } _nextv(t, e, r) { this[h] = false; if (this[a]) { return this.nextTick(r, null, []); } else if (this[s].length > 0) { t = Math.min(t, this[s].length); return this.nextTick(r, null, this[s].splice(0, t)); } if (this[c] !== undefined) { if (this[f].reverse) { this[u].lt = this[c]; this[u].lte = undefined; } else { this[u].gt = this[c]; this[u].gte = undefined; } } let n; try { n = i(this[u]); } catch (d) { this[a] = true; return this.nextTick(r, null, []); } const p = this.db.db.transaction([ this[l] ], 'readonly'); const b = p.objectStore(this[l]); const v = []; if (!this[f].reverse) { let y; let m; const w = ()=>{ if (y === undefined || m === undefined) return; const e = Math.max(y.length, m.length); if (e === 0 || t === Infinity) { this[a] = true; } else { this[c] = y[e - 1]; } v.length = e; for(let r = 0; r < e; r++){ const n = y[r]; const i = m[r]; v[r] = [ this[f].keys && n !== undefined ? o(n) : undefined, this[f].values && i !== undefined ? o(i) : undefined ]; } g(p); }; if (this[f].keys || t < Infinity) { b.getAllKeys(n, t < Infinity ? t : undefined).onsuccess = (t)=>{ y = t.target.result; w(); }; } else { y = []; this.nextTick(w); } if (this[f].values) { b.getAll(n, t < Infinity ? t : undefined).onsuccess = (t)=>{ m = t.target.result; w(); }; } else { m = []; this.nextTick(w); } } else { const _ = !this[f].values && b.openKeyCursor ? 'openKeyCursor' : 'openCursor'; b[_](n, 'prev').onsuccess = (e)=>{ const r = e.target.result; if (r) { const { key: n , value: i } = r; this[c] = n; v.push([ this[f].keys && n !== undefined ? o(n) : undefined, this[f].values && i !== undefined ? o(i) : undefined ]); if (v.length < t) { r.continue(); } else { g(p); } } else { this[a] = true; } }; } p.onabort = ()=>{ r(p.error || new Error('aborted by user')); r = null; }; p.oncomplete = ()=>{ r(null, v); r = null; }; } _next(t) { if (this[s].length > 0) { const [e, r] = this[s].shift(); this.nextTick(t, null, e, r); } else if (this[a]) { this.nextTick(t); } else { let n = Math.min(100, this.limit - this.count); if (this[h]) { this[h] = false; n = 1; } this._nextv(n, d, (e, r)=>{ if (e) return t(e); this[s] = r; this._next(t); }); } } _all(t, e) { this[h] = false; const r = this[s].splice(0, this[s].length); const n = this.limit - this.count - r.length; if (n <= 0) { return this.nextTick(e, null, r); } this._nextv(n, d, (t, n)=>{ if (t) return e(t); if (r.length > 0) n = r.concat(n); e(null, n); }); } _seek(t, e) { this[h] = true; this[s] = []; this[a] = false; this[c] = undefined; this[u] = { ...this[f] }; let r; try { r = i(this[f]); } catch (n) { this[a] = true; return; } if (r !== null && !r.includes(t)) { this[a] = true; } else if (this[f].reverse) { this[u].lte = t; } else { this[u].gte = t; } } } e.Iterator = p; function g(t) { if (typeof t.commit === 'function') { t.commit(); } } }), 7753: (function(t) { "use strict"; t.exports = function t(e, r, n, i, o) { if (i.limit === 0) return e.nextTick(o); const s = e.db.transaction([ r ], 'readwrite'); const a = s.objectStore(r); let f = 0; s.oncomplete = function() { o(); }; s.onabort = function() { o(s.error || new Error('aborted by user')); }; const u = a.openKeyCursor ? 'openKeyCursor' : 'openCursor'; const c = i.reverse ? 'prev' : 'next'; a[u](n, c).onsuccess = function(t) { const e = t.target.result; if (e) { a.delete(e.key).onsuccess = function() { if (i.limit <= 0 || ++f < i.limit) { e.continue(); } }; } }; }; }), 9687: (function(t) { "use strict"; const e = new TextEncoder(); t.exports = function(t) { if (t instanceof Uint8Array) { return t; } else if (t instanceof ArrayBuffer) { return new Uint8Array(t); } else { return e.encode(t); } }; }), 1217: (function(t) { "use strict"; t.exports = function t(e) { const r = e.gte !== undefined ? e.gte : e.gt !== undefined ? e.gt : undefined; const n = e.lte !== undefined ? e.lte : e.lt !== undefined ? e.lt : undefined; const i = e.gte === undefined; const o = e.lte === undefined; if (r !== undefined && n !== undefined) { return IDBKeyRange.bound(r, n, i, o); } else if (r !== undefined) { return IDBKeyRange.lowerBound(r, i); } else if (n !== undefined) { return IDBKeyRange.upperBound(n, o); } else { return null; } }; }), 3533: (function(t, e, r) { const n = (r(9509).Buffer); t.exports = class t { constructor(t = n.from([])){ this.buffer = t; } read(t) { const e = this.buffer.subarray(0, t); this.buffer = this.buffer.subarray(t); return e; } write(t) { t = n.from(t); this.buffer = n.concat([ this.buffer, t ]); } }; }), 8764: (function(t, e, r) { "use strict"; const n = r(9742); const i = r(645); const o = (typeof Symbol === 'function' && typeof Symbol['for'] === 'function') ? Symbol['for']('nodejs.util.inspect.custom') : null; e.Buffer = u; e.SlowBuffer = w; e.INSPECT_MAX_BYTES = 50; const s = 0x7fffffff; e.kMaxLength = s; u.TYPED_ARRAY_SUPPORT = a(); if (!u.TYPED_ARRAY_SUPPORT && typeof console !== 'undefined' && typeof console.error === 'function') { console.error('This browser lacks typed array (Uint8Array) support which is required by ' + '`buffer` v5.x. Use `buffer` v4.x if you require old browser support.'); } function a() { try { const t = new Uint8Array(1); const e = { foo: function() { return 42; } }; Object.setPrototypeOf(e, Uint8Array.prototype); Object.setPrototypeOf(t, e); return t.foo() === 42; } catch (r) { return false; } } Object.defineProperty(u.prototype, 'parent', { enumerable: true, get: function() { if (!u.isBuffer(this)) return undefined; return this.buffer; } }); Object.defineProperty(u.prototype, 'offset', { enumerable: true, get: function() { if (!u.isBuffer(this)) return undefined; return this.byteOffset; } }); function f(t) { if (t > s) { throw new RangeError('The value "' + t + '" is invalid for option "size"'); } const e = new Uint8Array(t); Object.setPrototypeOf(e, u.prototype); return e; } function u(t, e, r) { if (typeof t === 'number') { if (typeof e === 'string') { throw new TypeError('The "string" argument must be of type string. Received type number'); } return d(t); } return c(t, e, r); } u.poolSize = 8192; function c(t, e, r) { if (typeof t === 'string') { return p(t, e); } if (ArrayBuffer.isView(t)) { return b(t); } if (t == null) { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof t)); } if (ts(t, ArrayBuffer) || (t && ts(t.buffer, ArrayBuffer))) { return v(t, e, r); } if (typeof SharedArrayBuffer !== 'undefined' && (ts(t, SharedArrayBuffer) || (t && ts(t.buffer, SharedArrayBuffer)))) { return v(t, e, r); } if (typeof t === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type number'); } const n = t.valueOf && t.valueOf(); if (n != null && n !== t) { return u.from(n, e, r); } const i = y(t); if (i) return i; if (typeof Symbol !== 'undefined' && Symbol.toPrimitive != null && typeof t[Symbol.toPrimitive] === 'function') { return u.from(t[Symbol.toPrimitive]('string'), e, r); } throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, ' + 'or Array-like Object. Received type ' + (typeof t)); } u.from = function(t, e, r) { return c(t, e, r); }; Object.setPrototypeOf(u.prototype, Uint8Array.prototype); Object.setPrototypeOf(u, Uint8Array); function l(t) { if (typeof t !== 'number') { throw new TypeError('"size" argument must be of type number'); } else if (t < 0) { throw new RangeError('The value "' + t + '" is invalid for option "size"'); } } function h(t, e, r) { l(t); if (t <= 0) { return f(t); } if (e !== undefined) { return typeof r === 'string' ? f(t).fill(e, r) : f(t).fill(e); } return f(t); } u.alloc = function(t, e, r) { return h(t, e, r); }; function d(t) { l(t); return f(t < 0 ? 0 : m(t) | 0); } u.allocUnsafe = function(t) { return d(t); }; u.allocUnsafeSlow = function(t) { return d(t); }; function p(t, e) { if (typeof e !== 'string' || e === '') { e = 'utf8'; } if (!u.isEncoding(e)) { throw new TypeError('Unknown encoding: ' + e); } const r = _(t, e) | 0; let n = f(r); const i = n.write(t, e); if (i !== r) { n = n.slice(0, i); } return n; } function g(t) { const e = t.length < 0 ? 0 : m(t.length) | 0; const r = f(e); for(let n = 0; n < e; n += 1){ r[n] = t[n] & 255; } return r; } function b(t) { if (ts(t, Uint8Array)) { const e = new Uint8Array(t); return v(e.buffer, e.byteOffset, e.byteLength); } return g(t); } function v(t, e, r) { if (e < 0 || t.byteLength < e) { throw new RangeError('"offset" is outside of buffer bounds'); } if (t.byteLength < e + (r || 0)) { throw new RangeError('"length" is outside of buffer bounds'); } let n; if (e === undefined && r === undefined) { n = new Uint8Array(t); } else if (r === undefined) { n = new Uint8Array(t, e); } else { n = new Uint8Array(t, e, r); } Object.setPrototypeOf(n, u.prototype); return n; } function y(t) { if (u.isBuffer(t)) { const e = m(t.length) | 0; const r = f(e); if (r.length === 0) { return r; } t.copy(r, 0, 0, e); return r; } if (t.length !== undefined) { if (typeof t.length !== 'number' || ta(t.length)) { return f(0); } return g(t); } if (t.type === 'Buffer' && Array.isArray(t.data)) { return g(t.data); } } function m(t) { if (t >= s) { throw new RangeError('Attempt to allocate Buffer larger than maximum ' + 'size: 0x' + s.toString(16) + ' bytes'); } return t | 0; } function w(t) { if (+t != t) { t = 0; } return u.alloc(+t); } u.isBuffer = function t(e) { return e != null && e._isBuffer === true && e !== u.prototype; }; u.compare = function t(e, r) { if (ts(e, Uint8Array)) e = u.from(e, e.offset, e.byteLength); if (ts(r, Uint8Array)) r = u.from(r, r.offset, r.byteLength); if (!u.isBuffer(e) || !u.isBuffer(r)) { throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array'); } if (e === r) return 0; let n = e.length; let i = r.length; for(let o = 0, s = Math.min(n, i); o < s; ++o){ if (e[o] !== r[o]) { n = e[o]; i = r[o]; break; } } if (n < i) return -1; if (i < n) return 1; return 0; }; u.isEncoding = function t(e) { switch(String(e).toLowerCase()){ case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'latin1': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return true; default: return false; } }; u.concat = function t(e, r) { if (!Array.isArray(e)) { throw new TypeError('"list" argument must be an Array of Buffers'); } if (e.length === 0) { return u.alloc(0); } let n; if (r === undefined) { r = 0; for(n = 0; n < e.length; ++n){ r += e[n].length; } } const i = u.allocUnsafe(r); let o = 0; for(n = 0; n < e.length; ++n){ let s = e[n]; if (ts(s, Uint8Array)) { if (o + s.length > i.length) { if (!u.isBuffer(s)) s = u.from(s); s.copy(i, o); } else { Uint8Array.prototype.set.call(i, s, o); } } else if (!u.isBuffer(s)) { throw new TypeError('"list" argument must be an Array of Buffers'); } else { s.copy(i, o); } o += s.length; } return i; }; function _(t, e) { if (u.isBuffer(t)) { return t.length; } if (ArrayBuffer.isView(t) || ts(t, ArrayBuffer)) { return t.byteLength; } if (typeof t !== 'string') { throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. ' + 'Received type ' + typeof t); } const r = t.length; const n = (arguments.length > 2 && arguments[2] === true); if (!n && r === 0) return 0; let i = false; for(;;){ switch(e){ case 'ascii': case 'latin1': case 'binary': return r; case 'utf8': case 'utf-8': return te(t).length; case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return r * 2; case 'hex': return r >>> 1; case 'base64': return ti(t).length; default: if (i) { return n ? -1 : te(t).length; } e = ('' + e).toLowerCase(); i = true; } } } u.byteLength = _; function S(t, e, r) { let n = false; if (e === undefined || e < 0) { e = 0; } if (e > this.length) { return ''; } if (r === undefined || r > this.length) { r = this.length; } if (r <= 0) { return ''; } r >>>= 0; e >>>= 0; if (r <= e) { return ''; } if (!t) t = 'utf8'; while(true){ switch(t){ case 'hex': return L(this, e, r); case 'utf8': case 'utf-8': return N(this, e, r); case 'ascii': return C(this, e, r); case 'latin1': case 'binary': return B(this, e, r); case 'base64': return R(this, e, r); case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return U(this, e, r); default: if (n) throw new TypeError('Unknown encoding: ' + t); t = (t + '').toLowerCase(); n = true; } } } u.prototype._isBuffer = true; function E(t, e, r) { const n = t[e]; t[e] = t[r]; t[r] = n; } u.prototype.swap16 = function t() { const e = this.length; if (e % 2 !== 0) { throw new RangeError('Buffer size must be a multiple of 16-bits'); } for(let r = 0; r < e; r += 2){ E(this, r, r + 1); } return this; }; u.prototype.swap32 = function t() { const e = this.length; if (e % 4 !== 0) { throw new RangeError('Buffer size must be a multiple of 32-bits'); } for(let r = 0; r < e; r += 4){ E(this, r, r + 3); E(this, r + 1, r + 2); } return this; }; u.prototype.swap64 = function t() { const e = this.length; if (e % 8 !== 0) { throw new RangeError('Buffer size must be a multiple of 64-bits'); } for(let r = 0; r < e; r += 8){ E(this, r, r + 7); E(this, r + 1, r + 6); E(this, r + 2, r + 5); E(this, r + 3, r + 4); } return this; }; u.prototype.toString = function t() { const e = this.length; if (e === 0) return ''; if (arguments.length === 0) return N(this, 0, e); return S.apply(this, arguments); }; u.prototype.toLocaleString = u.prototype.toString; u.prototype.equals = function t(e) { if (!u.isBuffer(e)) throw new TypeError('Argument must be a Buffer'); if (this === e) return true; return u.compare(this, e) === 0; }; u.prototype.inspect = function t() { let r = ''; const n = e.INSPECT_MAX_BYTES; r = this.toString('hex', 0, n).replace(/(.{2})/g, '$1 ').trim(); if (this.length > n) r += ' ... '; return ''; }; if (o) { u.prototype[o] = u.prototype.inspect; } u.prototype.compare = function t(e, r, n, i, o) { if (ts(e, Uint8Array)) { e = u.from(e, e.offset, e.byteLength); } if (!u.isBuffer(e)) { throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. ' + 'Received type ' + (typeof e)); } if (r === undefined) { r = 0; } if (n === undefined) { n = e ? e.length : 0; } if (i === undefined) { i = 0; } if (o === undefined) { o = this.length; } if (r < 0 || n > e.length || i < 0 || o > this.length) { throw new RangeError('out of range index'); } if (i >= o && r >= n) { return 0; } if (i >= o) { return -1; } if (r >= n) { return 1; } r >>>= 0; n >>>= 0; i >>>= 0; o >>>= 0; if (this === e) return 0; let s = o - i; let a = n - r; const f = Math.min(s, a); const c = this.slice(i, o); const l = e.slice(r, n); for(let h = 0; h < f; ++h){ if (c[h] !== l[h]) { s = c[h]; a = l[h]; break; } } if (s < a) return -1; if (a < s) return 1; return 0; }; function x(t, e, r, n, i) { if (t.length === 0) return -1; if (typeof r === 'string') { n = r; r = 0; } else if (r > 0x7fffffff) { r = 0x7fffffff; } else if (r < -0x80000000) { r = -0x80000000; } r = +r; if (ta(r)) { r = i ? 0 : (t.length - 1); } if (r < 0) r = t.length + r; if (r >= t.length) { if (i) return -1; else r = t.length - 1; } else if (r < 0) { if (i) r = 0; else return -1; } if (typeof e === 'string') { e = u.from(e, n); } if (u.isBuffer(e)) { if (e.length === 0) { return -1; } return M(t, e, r, n, i); } else if (typeof e === 'number') { e = e & 0xFF; if (typeof Uint8Array.prototype.indexOf === 'function') { if (i) { return Uint8Array.prototype.indexOf.call(t, e, r); } else { return Uint8Array.prototype.lastIndexOf.call(t, e, r); } } return M(t, [ e ], r, n, i); } throw new TypeError('val must be string, number or Buffer'); } function M(t, e, r, n, i) { let o = 1; let s = t.length; let a = e.length; if (n !== undefined) { n = String(n).toLowerCase(); if (n === 'ucs2' || n === 'ucs-2' || n === 'utf16le' || n === 'utf-16le') { if (t.length < 2 || e.length < 2) { return -1; } o = 2; s /= 2; a /= 2; r /= 2; } } function f(t, e) { if (o === 1) { return t[e]; } else { return t.readUInt16BE(e * o); } } let u; if (i) { let c = -1; for(u = r; u < s; u++){ if (f(t, u) === f(e, c === -1 ? 0 : u - c)) { if (c === -1) c = u; if (u - c + 1 === a) return c * o; } else { if (c !== -1) u -= u - c; c = -1; } } } else { if (r + a > s) r = s - a; for(u = r; u >= 0; u--){ let l = true; for(let h = 0; h < a; h++){ if (f(t, u + h) !== f(e, h)) { l = false; break; } } if (l) return u; } } return -1; } u.prototype.includes = function t(e, r, n) { return this.indexOf(e, r, n) !== -1; }; u.prototype.indexOf = function t(e, r, n) { return x(this, e, r, n, true); }; u.prototype.lastIndexOf = function t(e, r, n) { return x(this, e, r, n, false); }; function T(t, e, r, n) { r = Number(r) || 0; const i = t.length - r; if (!n) { n = i; } else { n = Number(n); if (n > i) { n = i; } } const o = e.length; if (n > o / 2) { n = o / 2; } let s; for(s = 0; s < n; ++s){ const a = parseInt(e.substr(s * 2, 2), 16); if (ta(a)) return s; t[r + s] = a; } return s; } function A(t, e, r, n) { return to(te(e, t.length - r), t, r, n); } function O(t, e, r, n) { return to(tr(e), t, r, n); } function k(t, e, r, n) { return to(ti(e), t, r, n); } function I(t, e, r, n) { return to(tn(e, t.length - r), t, r, n); } u.prototype.write = function t(e, r, n, i) { if (r === undefined) { i = 'utf8'; n = this.length; r = 0; } else if (n === undefined && typeof r === 'string') { i = r; n = this.length; r = 0; } else if (isFinite(r)) { r = r >>> 0; if (isFinite(n)) { n = n >>> 0; if (i === undefined) i = 'utf8'; } else { i = n; n = undefined; } } else { throw new Error('Buffer.write(string, encoding, offset[, length]) is no longer supported'); } const o = this.length - r; if (n === undefined || n > o) n = o; if ((e.length > 0 && (n < 0 || r < 0)) || r > this.length) { throw new RangeError('Attempt to write outside buffer bounds'); } if (!i) i = 'utf8'; let s = false; for(;;){ switch(i){ case 'hex': return T(this, e, r, n); case 'utf8': case 'utf-8': return A(this, e, r, n); case 'ascii': case 'latin1': case 'binary': return O(this, e, r, n); case 'base64': return k(this, e, r, n); case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return I(this, e, r, n); default: if (s) throw new TypeError('Unknown encoding: ' + i); i = ('' + i).toLowerCase(); s = true; } } }; u.prototype.toJSON = function t() { return { type: 'Buffer', data: Array.prototype.slice.call(this._arr || this, 0) }; }; function R(t, e, r) { if (e === 0 && r === t.length) { return n.fromByteArray(t); } else { return n.fromByteArray(t.slice(e, r)); } } function N(t, e, r) { r = Math.min(t.length, r); const n = []; let i = e; while(i < r){ const o = t[i]; let s = null; let a = (o > 0xEF) ? 4 : (o > 0xDF) ? 3 : (o > 0xBF) ? 2 : 1; if (i + a <= r) { let f, u, c, l; switch(a){ case 1: if (o < 0x80) { s = o; } break; case 2: f = t[i + 1]; if ((f & 0xC0) === 0x80) { l = (o & 0x1F) << 0x6 | (f & 0x3F); if (l > 0x7F) { s = l; } } break; case 3: f = t[i + 1]; u = t[i + 2]; if ((f & 0xC0) === 0x80 && (u & 0xC0) === 0x80) { l = (o & 0xF) << 0xC | (f & 0x3F) << 0x6 | (u & 0x3F); if (l > 0x7FF && (l < 0xD800 || l > 0xDFFF)) { s = l; } } break; case 4: f = t[i + 1]; u = t[i + 2]; c = t[i + 3]; if ((f & 0xC0) === 0x80 && (u & 0xC0) === 0x80 && (c & 0xC0) === 0x80) { l = (o & 0xF) << 0x12 | (f & 0x3F) << 0xC | (u & 0x3F) << 0x6 | (c & 0x3F); if (l > 0xFFFF && l < 0x110000) { s = l; } } } } if (s === null) { s = 0xFFFD; a = 1; } else if (s > 0xFFFF) { s -= 0x10000; n.push(s >>> 10 & 0x3FF | 0xD800); s = 0xDC00 | s & 0x3FF; } n.push(s); i += a; } return P(n); } const j = 0x1000; function P(t) { const e = t.length; if (e <= j) { return String.fromCharCode.apply(String, t); } let r = ''; let n = 0; while(n < e){ r += String.fromCharCode.apply(String, t.slice(n, n += j)); } return r; } function C(t, e, r) { let n = ''; r = Math.min(t.length, r); for(let i = e; i < r; ++i){ n += String.fromCharCode(t[i] & 0x7F); } return n; } function B(t, e, r) { let n = ''; r = Math.min(t.length, r); for(let i = e; i < r; ++i){ n += String.fromCharCode(t[i]); } return n; } function L(t, e, r) { const n = t.length; if (!e || e < 0) e = 0; if (!r || r < 0 || r > n) r = n; let i = ''; for(let o = e; o < r; ++o){ i += tf[t[o]]; } return i; } function U(t, e, r) { const n = t.slice(e, r); let i = ''; for(let o = 0; o < n.length - 1; o += 2){ i += String.fromCharCode(n[o] + (n[o + 1] * 256)); } return i; } u.prototype.slice = function t(e, r) { const n = this.length; e = ~~e; r = r === undefined ? n : ~~r; if (e < 0) { e += n; if (e < 0) e = 0; } else if (e > n) { e = n; } if (r < 0) { r += n; if (r < 0) r = 0; } else if (r > n) { r = n; } if (r < e) r = e; const i = this.subarray(e, r); Object.setPrototypeOf(i, u.prototype); return i; }; function D(t, e, r) { if ((t % 1) !== 0 || t < 0) throw new RangeError('offset is not uint'); if (t + e > r) throw new RangeError('Trying to access beyond buffer length'); } u.prototype.readUintLE = u.prototype.readUIntLE = function t(e, r, n) { e = e >>> 0; r = r >>> 0; if (!n) D(e, r, this.length); let i = this[e]; let o = 1; let s = 0; while(++s < r && (o *= 0x100)){ i += this[e + s] * o; } return i; }; u.prototype.readUintBE = u.prototype.readUIntBE = function t(e, r, n) { e = e >>> 0; r = r >>> 0; if (!n) { D(e, r, this.length); } let i = this[e + --r]; let o = 1; while(r > 0 && (o *= 0x100)){ i += this[e + --r] * o; } return i; }; u.prototype.readUint8 = u.prototype.readUInt8 = function t(e, r) { e = e >>> 0; if (!r) D(e, 1, this.length); return this[e]; }; u.prototype.readUint16LE = u.prototype.readUInt16LE = function t(e, r) { e = e >>> 0; if (!r) D(e, 2, this.length); return this[e] | (this[e + 1] << 8); }; u.prototype.readUint16BE = u.prototype.readUInt16BE = function t(e, r) { e = e >>> 0; if (!r) D(e, 2, this.length); return (this[e] << 8) | this[e + 1]; }; u.prototype.readUint32LE = u.prototype.readUInt32LE = function t(e, r) { e = e >>> 0; if (!r) D(e, 4, this.length); return ((this[e]) | (this[e + 1] << 8) | (this[e + 2] << 16)) + (this[e + 3] * 0x1000000); }; u.prototype.readUint32BE = u.prototype.readUInt32BE = function t(e, r) { e = e >>> 0; if (!r) D(e, 4, this.length); return (this[e] * 0x1000000) + ((this[e + 1] << 16) | (this[e + 2] << 8) | this[e + 3]); }; u.prototype.readBigUInt64LE = tu(function t(e) { e = e >>> 0; Y(e, 'offset'); const r = this[e]; const n = this[e + 7]; if (r === undefined || n === undefined) { Z(e, this.length - 8); } const i = r + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24; const o = this[++e] + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + n * 2 ** 24; return BigInt(i) + (BigInt(o) << BigInt(32)); }); u.prototype.readBigUInt64BE = tu(function t(e) { e = e >>> 0; Y(e, 'offset'); const r = this[e]; const n = this[e + 7]; if (r === undefined || n === undefined) { Z(e, this.length - 8); } const i = r * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e]; const o = this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n; return (BigInt(i) << BigInt(32)) + BigInt(o); }); u.prototype.readIntLE = function t(e, r, n) { e = e >>> 0; r = r >>> 0; if (!n) D(e, r, this.length); let i = this[e]; let o = 1; let s = 0; while(++s < r && (o *= 0x100)){ i += this[e + s] * o; } o *= 0x80; if (i >= o) i -= Math.pow(2, 8 * r); return i; }; u.prototype.readIntBE = function t(e, r, n) { e = e >>> 0; r = r >>> 0; if (!n) D(e, r, this.length); let i = r; let o = 1; let s = this[e + --i]; while(i > 0 && (o *= 0x100)){ s += this[e + --i] * o; } o *= 0x80; if (s >= o) s -= Math.pow(2, 8 * r); return s; }; u.prototype.readInt8 = function t(e, r) { e = e >>> 0; if (!r) D(e, 1, this.length); if (!(this[e] & 0x80)) return (this[e]); return ((0xff - this[e] + 1) * -1); }; u.prototype.readInt16LE = function t(e, r) { e = e >>> 0; if (!r) D(e, 2, this.length); const n = this[e] | (this[e + 1] << 8); return (n & 0x8000) ? n | 0xFFFF0000 : n; }; u.prototype.readInt16BE = function t(e, r) { e = e >>> 0; if (!r) D(e, 2, this.length); const n = this[e + 1] | (this[e] << 8); return (n & 0x8000) ? n | 0xFFFF0000 : n; }; u.prototype.readInt32LE = function t(e, r) { e = e >>> 0; if (!r) D(e, 4, this.length); return (this[e]) | (this[e + 1] << 8) | (this[e + 2] << 16) | (this[e + 3] << 24); }; u.prototype.readInt32BE = function t(e, r) { e = e >>> 0; if (!r) D(e, 4, this.length); return (this[e] << 24) | (this[e + 1] << 16) | (this[e + 2] << 8) | (this[e + 3]); }; u.prototype.readBigInt64LE = tu(function t(e) { e = e >>> 0; Y(e, 'offset'); const r = this[e]; const n = this[e + 7]; if (r === undefined || n === undefined) { Z(e, this.length - 8); } const i = this[e + 4] + this[e + 5] * 2 ** 8 + this[e + 6] * 2 ** 16 + (n << 24); return (BigInt(i) << BigInt(32)) + BigInt(r + this[++e] * 2 ** 8 + this[++e] * 2 ** 16 + this[++e] * 2 ** 24); }); u.prototype.readBigInt64BE = tu(function t(e) { e = e >>> 0; Y(e, 'offset'); const r = this[e]; const n = this[e + 7]; if (r === undefined || n === undefined) { Z(e, this.length - 8); } const i = (r << 24) + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + this[++e]; return (BigInt(i) << BigInt(32)) + BigInt(this[++e] * 2 ** 24 + this[++e] * 2 ** 16 + this[++e] * 2 ** 8 + n); }); u.prototype.readFloatLE = function t(e, r) { e = e >>> 0; if (!r) D(e, 4, this.length); return i.read(this, e, true, 23, 4); }; u.prototype.readFloatBE = function t(e, r) { e = e >>> 0; if (!r) D(e, 4, this.length); return i.read(this, e, false, 23, 4); }; u.prototype.readDoubleLE = function t(e, r) { e = e >>> 0; if (!r) D(e, 8, this.length); return i.read(this, e, true, 52, 8); }; u.prototype.readDoubleBE = function t(e, r) { e = e >>> 0; if (!r) D(e, 8, this.length); return i.read(this, e, false, 52, 8); }; function $(t, e, r, n, i, o) { if (!u.isBuffer(t)) throw new TypeError('"buffer" argument must be a Buffer instance'); if (e > i || e < o) throw new RangeError('"value" argument is out of bounds'); if (r + n > t.length) throw new RangeError('Index out of range'); } u.prototype.writeUintLE = u.prototype.writeUIntLE = function t(e, r, n, i) { e = +e; r = r >>> 0; n = n >>> 0; if (!i) { const o = Math.pow(2, 8 * n) - 1; $(this, e, r, n, o, 0); } let s = 1; let a = 0; this[r] = e & 0xFF; while(++a < n && (s *= 0x100)){ this[r + a] = (e / s) & 0xFF; } return r + n; }; u.prototype.writeUintBE = u.prototype.writeUIntBE = function t(e, r, n, i) { e = +e; r = r >>> 0; n = n >>> 0; if (!i) { const o = Math.pow(2, 8 * n) - 1; $(this, e, r, n, o, 0); } let s = n - 1; let a = 1; this[r + s] = e & 0xFF; while(--s >= 0 && (a *= 0x100)){ this[r + s] = (e / a) & 0xFF; } return r + n; }; u.prototype.writeUint8 = u.prototype.writeUInt8 = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 1, 0xff, 0); this[r] = (e & 0xff); return r + 1; }; u.prototype.writeUint16LE = u.prototype.writeUInt16LE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 2, 0xffff, 0); this[r] = (e & 0xff); this[r + 1] = (e >>> 8); return r + 2; }; u.prototype.writeUint16BE = u.prototype.writeUInt16BE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 2, 0xffff, 0); this[r] = (e >>> 8); this[r + 1] = (e & 0xff); return r + 2; }; u.prototype.writeUint32LE = u.prototype.writeUInt32LE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 4, 0xffffffff, 0); this[r + 3] = (e >>> 24); this[r + 2] = (e >>> 16); this[r + 1] = (e >>> 8); this[r] = (e & 0xff); return r + 4; }; u.prototype.writeUint32BE = u.prototype.writeUInt32BE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 4, 0xffffffff, 0); this[r] = (e >>> 24); this[r + 1] = (e >>> 16); this[r + 2] = (e >>> 8); this[r + 3] = (e & 0xff); return r + 4; }; function F(t, e, r, n, i) { X(e, n, i, t, r, 7); let o = Number(e & BigInt(0xffffffff)); t[r++] = o; o = o >> 8; t[r++] = o; o = o >> 8; t[r++] = o; o = o >> 8; t[r++] = o; let s = Number(e >> BigInt(32) & BigInt(0xffffffff)); t[r++] = s; s = s >> 8; t[r++] = s; s = s >> 8; t[r++] = s; s = s >> 8; t[r++] = s; return r; } function W(t, e, r, n, i) { X(e, n, i, t, r, 7); let o = Number(e & BigInt(0xffffffff)); t[r + 7] = o; o = o >> 8; t[r + 6] = o; o = o >> 8; t[r + 5] = o; o = o >> 8; t[r + 4] = o; let s = Number(e >> BigInt(32) & BigInt(0xffffffff)); t[r + 3] = s; s = s >> 8; t[r + 2] = s; s = s >> 8; t[r + 1] = s; s = s >> 8; t[r] = s; return r + 8; } u.prototype.writeBigUInt64LE = tu(function t(e, r = 0) { return F(this, e, r, BigInt(0), BigInt('0xffffffffffffffff')); }); u.prototype.writeBigUInt64BE = tu(function t(e, r = 0) { return W(this, e, r, BigInt(0), BigInt('0xffffffffffffffff')); }); u.prototype.writeIntLE = function t(e, r, n, i) { e = +e; r = r >>> 0; if (!i) { const o = Math.pow(2, (8 * n) - 1); $(this, e, r, n, o - 1, -o); } let s = 0; let a = 1; let f = 0; this[r] = e & 0xFF; while(++s < n && (a *= 0x100)){ if (e < 0 && f === 0 && this[r + s - 1] !== 0) { f = 1; } this[r + s] = ((e / a) >> 0) - f & 0xFF; } return r + n; }; u.prototype.writeIntBE = function t(e, r, n, i) { e = +e; r = r >>> 0; if (!i) { const o = Math.pow(2, (8 * n) - 1); $(this, e, r, n, o - 1, -o); } let s = n - 1; let a = 1; let f = 0; this[r + s] = e & 0xFF; while(--s >= 0 && (a *= 0x100)){ if (e < 0 && f === 0 && this[r + s + 1] !== 0) { f = 1; } this[r + s] = ((e / a) >> 0) - f & 0xFF; } return r + n; }; u.prototype.writeInt8 = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 1, 0x7f, -0x80); if (e < 0) e = 0xff + e + 1; this[r] = (e & 0xff); return r + 1; }; u.prototype.writeInt16LE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 2, 0x7fff, -0x8000); this[r] = (e & 0xff); this[r + 1] = (e >>> 8); return r + 2; }; u.prototype.writeInt16BE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 2, 0x7fff, -0x8000); this[r] = (e >>> 8); this[r + 1] = (e & 0xff); return r + 2; }; u.prototype.writeInt32LE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 4, 0x7fffffff, -0x80000000); this[r] = (e & 0xff); this[r + 1] = (e >>> 8); this[r + 2] = (e >>> 16); this[r + 3] = (e >>> 24); return r + 4; }; u.prototype.writeInt32BE = function t(e, r, n) { e = +e; r = r >>> 0; if (!n) $(this, e, r, 4, 0x7fffffff, -0x80000000); if (e < 0) e = 0xffffffff + e + 1; this[r] = (e >>> 24); this[r + 1] = (e >>> 16); this[r + 2] = (e >>> 8); this[r + 3] = (e & 0xff); return r + 4; }; u.prototype.writeBigInt64LE = tu(function t(e, r = 0) { return F(this, e, r, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')); }); u.prototype.writeBigInt64BE = tu(function t(e, r = 0) { return W(this, e, r, -BigInt('0x8000000000000000'), BigInt('0x7fffffffffffffff')); }); function q(t, e, r, n, i, o) { if (r + n > t.length) throw new RangeError('Index out of range'); if (r < 0) throw new RangeError('Index out of range'); } function z(t, e, r, n, o) { e = +e; r = r >>> 0; if (!o) { q(t, e, r, 4, 3.4028234663852886e+38, -3.4028234663852886e+38); } i.write(t, e, r, n, 23, 4); return r + 4; } u.prototype.writeFloatLE = function t(e, r, n) { return z(this, e, r, true, n); }; u.prototype.writeFloatBE = function t(e, r, n) { return z(this, e, r, false, n); }; function G(t, e, r, n, o) { e = +e; r = r >>> 0; if (!o) { q(t, e, r, 8, 1.7976931348623157E+308, -1.7976931348623157E+308); } i.write(t, e, r, n, 52, 8); return r + 8; } u.prototype.writeDoubleLE = function t(e, r, n) { return G(this, e, r, true, n); }; u.prototype.writeDoubleBE = function t(e, r, n) { return G(this, e, r, false, n); }; u.prototype.copy = function t(e, r, n, i) { if (!u.isBuffer(e)) throw new TypeError('argument should be a Buffer'); if (!n) n = 0; if (!i && i !== 0) i = this.length; if (r >= e.length) r = e.length; if (!r) r = 0; if (i > 0 && i < n) i = n; if (i === n) return 0; if (e.length === 0 || this.length === 0) return 0; if (r < 0) { throw new RangeError('targetStart out of bounds'); } if (n < 0 || n >= this.length) throw new RangeError('Index out of range'); if (i < 0) throw new RangeError('sourceEnd out of bounds'); if (i > this.length) i = this.length; if (e.length - r < i - n) { i = e.length - r + n; } const o = i - n; if (this === e && typeof Uint8Array.prototype.copyWithin === 'function') { this.copyWithin(r, n, i); } else { Uint8Array.prototype.set.call(e, this.subarray(n, i), r); } return o; }; u.prototype.fill = function t(e, r, n, i) { if (typeof e === 'string') { if (typeof r === 'string') { i = r; r = 0; n = this.length; } else if (typeof n === 'string') { i = n; n = this.length; } if (i !== undefined && typeof i !== 'string') { throw new TypeError('encoding must be a string'); } if (typeof i === 'string' && !u.isEncoding(i)) { throw new TypeError('Unknown encoding: ' + i); } if (e.length === 1) { const o = e.charCodeAt(0); if ((i === 'utf8' && o < 128) || i === 'latin1') { e = o; } } } else if (typeof e === 'number') { e = e & 255; } else if (typeof e === 'boolean') { e = Number(e); } if (r < 0 || this.length < r || this.length < n) { throw new RangeError('Out of range index'); } if (n <= r) { return this; } r = r >>> 0; n = n === undefined ? this.length : n >>> 0; if (!e) e = 0; let s; if (typeof e === 'number') { for(s = r; s < n; ++s){ this[s] = e; } } else { const a = u.isBuffer(e) ? e : u.from(e, i); const f = a.length; if (f === 0) { throw new TypeError('The value "' + e + '" is invalid for argument "value"'); } for(s = 0; s < n - r; ++s){ this[s + r] = a[s % f]; } } return this; }; const K = {}; function V(t, e, r) { K[t] = class n extends r { constructor(){ super(); Object.defineProperty(this, 'message', { value: e.apply(this, arguments), writable: true, configurable: true }); this.name = `${this.name} [${t}]`; this.stack; delete this.name; } get code() { return t; } set code(t) { Object.defineProperty(this, 'code', { configurable: true, enumerable: true, value: t, writable: true }); } toString() { return `${this.name} [${t}]: ${this.message}`; } }; } V('ERR_BUFFER_OUT_OF_BOUNDS', function(t) { if (t) { return `${t} is outside of buffer bounds`; } return 'Attempt to access memory outside buffer bounds'; }, RangeError); V('ERR_INVALID_ARG_TYPE', function(t, e) { return `The "${t}" argument must be of type number. Received type ${typeof e}`; }, TypeError); V('ERR_OUT_OF_RANGE', function(t, e, r) { let n = `The value of "${t}" is out of range.`; let i = r; if (Number.isInteger(r) && Math.abs(r) > 2 ** 32) { i = H(String(r)); } else if (typeof r === 'bigint') { i = String(r); if (r > BigInt(2) ** BigInt(32) || r < -(BigInt(2) ** BigInt(32))) { i = H(i); } i += 'n'; } n += ` It must be ${e}. Received ${i}`; return n; }, RangeError); function H(t) { let e = ''; let r = t.length; const n = t[0] === '-' ? 1 : 0; for(; r >= n + 4; r -= 3){ e = `_${t.slice(r - 3, r)}${e}`; } return `${t.slice(0, r)}${e}`; } function J(t, e, r) { Y(e, 'offset'); if (t[e] === undefined || t[e + r] === undefined) { Z(e, t.length - (r + 1)); } } function X(t, e, r, n, i, o) { if (t > r || t < e) { const s = typeof e === 'bigint' ? 'n' : ''; let a; if (o > 3) { if (e === 0 || e === BigInt(0)) { a = `>= 0${s} and < 2${s} ** ${(o + 1) * 8}${s}`; } else { a = `>= -(2${s} ** ${(o + 1) * 8 - 1}${s}) and < 2 ** ` + `${(o + 1) * 8 - 1}${s}`; } } else { a = `>= ${e}${s} and <= ${r}${s}`; } throw new K.ERR_OUT_OF_RANGE('value', a, t); } J(n, i, o); } function Y(t, e) { if (typeof t !== 'number') { throw new K.ERR_INVALID_ARG_TYPE(e, 'number', t); } } function Z(t, e, r) { if (Math.floor(t) !== t) { Y(t, r); throw new K.ERR_OUT_OF_RANGE(r || 'offset', 'an integer', t); } if (e < 0) { throw new K.ERR_BUFFER_OUT_OF_BOUNDS(); } throw new K.ERR_OUT_OF_RANGE(r || 'offset', `>= ${r ? 1 : 0} and <= ${e}`, t); } const Q = /[^+/0-9A-Za-z-_]/g; function tt(t) { t = t.split('=')[0]; t = t.trim().replace(Q, ''); if (t.length < 2) return ''; while(t.length % 4 !== 0){ t = t + '='; } return t; } function te(t, e) { e = e || Infinity; let r; const n = t.length; let i = null; const o = []; for(let s = 0; s < n; ++s){ r = t.charCodeAt(s); if (r > 0xD7FF && r < 0xE000) { if (!i) { if (r > 0xDBFF) { if ((e -= 3) > -1) o.push(0xEF, 0xBF, 0xBD); continue; } else if (s + 1 === n) { if ((e -= 3) > -1) o.push(0xEF, 0xBF, 0xBD); continue; } i = r; continue; } if (r < 0xDC00) { if ((e -= 3) > -1) o.push(0xEF, 0xBF, 0xBD); i = r; continue; } r = (i - 0xD800 << 10 | r - 0xDC00) + 0x10000; } else if (i) { if ((e -= 3) > -1) o.push(0xEF, 0xBF, 0xBD); } i = null; if (r < 0x80) { if ((e -= 1) < 0) break; o.push(r); } else if (r < 0x800) { if ((e -= 2) < 0) break; o.push(r >> 0x6 | 0xC0, r & 0x3F | 0x80); } else if (r < 0x10000) { if ((e -= 3) < 0) break; o.push(r >> 0xC | 0xE0, r >> 0x6 & 0x3F | 0x80, r & 0x3F | 0x80); } else if (r < 0x110000) { if ((e -= 4) < 0) break; o.push(r >> 0x12 | 0xF0, r >> 0xC & 0x3F | 0x80, r >> 0x6 & 0x3F | 0x80, r & 0x3F | 0x80); } else { throw new Error('Invalid code point'); } } return o; } function tr(t) { const e = []; for(let r = 0; r < t.length; ++r){ e.push(t.charCodeAt(r) & 0xFF); } return e; } function tn(t, e) { let r, n, i; const o = []; for(let s = 0; s < t.length; ++s){ if ((e -= 2) < 0) break; r = t.charCodeAt(s); n = r >> 8; i = r % 256; o.push(i); o.push(n); } return o; } function ti(t) { return n.toByteArray(tt(t)); } function to(t, e, r, n) { let i; for(i = 0; i < n; ++i){ if ((i + r >= e.length) || (i >= t.length)) break; e[i + r] = t[i]; } return i; } function ts(t, e) { return t instanceof e || (t != null && t.constructor != null && t.constructor.name != null && t.constructor.name === e.name); } function ta(t) { return t !== t; } const tf = (function() { const t = '0123456789abcdef'; const e = new Array(256); for(let r = 0; r < 16; ++r){ const n = r * 16; for(let i = 0; i < 16; ++i){ e[n + i] = t[r] + t[i]; } } return e; })(); function tu(t) { return typeof BigInt === 'undefined' ? tc : t; } function tc() { throw new Error('BigInt not supported'); } }), 1924: (function(t, e, r) { "use strict"; var n = r(210); var i = r(5559); var o = i(n('String.prototype.indexOf')); t.exports = function t(e, r) { var s = n(e, !!r); if (typeof s === 'function' && o(e, '.prototype.') > -1) { return i(s); } return s; }; }), 5559: (function(t, e, r) { "use strict"; var n = r(8612); var i = r(210); var o = i('%Function.prototype.apply%'); var s = i('%Function.prototype.call%'); var a = i('%Reflect.apply%', true) || n.call(s, o); var f = i('%Object.getOwnPropertyDescriptor%', true); var u = i('%Object.defineProperty%', true); var c = i('%Math.max%'); if (u) { try { u({}, 'a', { value: 1 }); } catch (l) { u = null; } } t.exports = function t(e) { var r = a(n, s, arguments); if (f && u) { var i = f(r, 'length'); if (i.configurable) { u(r, 'length', { value: 1 + c(0, e.length - (arguments.length - 1)) }); } } return r; }; var h = function t() { return a(n, o, arguments); }; if (u) { u(t.exports, 'apply', { value: h }); } else { t.exports.apply = h; } }), 6957: (function(t, e, r) { "use strict"; var n = r(886); e.fromCallback = function(t, e) { if (t === undefined) { var r = new Promise(function(e, r) { t = function(t, n) { if (t) r(t); else e(n); }; }); t[e !== undefined ? e : 'promise'] = r; } else if (typeof t !== 'function') { throw new TypeError('Callback must be a function'); } return t; }; e.fromPromise = function(t, e) { if (e === undefined) return t; t.then(function(t) { n(()=>e(null, t)); }).catch(function(t) { n(()=>e(t)); }); }; }), 886: (function(t) { t.exports = typeof queueMicrotask === 'function' ? queueMicrotask : (t)=>Promise.resolve().then(t); }), 6266: (function(t, e, r) { "use strict"; var n = e; n.version = (r(8597).i8); n.utils = r(953); n.rand = r(9931); n.curve = r(8254); n.curves = r(5427); n.ec = r(7954); n.eddsa = r(5980); }), 4918: (function(t, e, r) { "use strict"; var n = r(3550); var i = r(953); var o = i.getNAF; var s = i.getJSF; var a = i.assert; function f(t, e) { this.type = t; this.p = new n(e.p, 16); this.red = e.prime ? n.red(e.prime) : n.mont(this.p); this.zero = new n(0).toRed(this.red); this.one = new n(1).toRed(this.red); this.two = new n(2).toRed(this.red); this.n = e.n && new n(e.n, 16); this.g = e.g && this.pointFromJSON(e.g, e.gRed); this._wnafT1 = new Array(4); this._wnafT2 = new Array(4); this._wnafT3 = new Array(4); this._wnafT4 = new Array(4); this._bitLength = this.n ? this.n.bitLength() : 0; var r = this.n && this.p.div(this.n); if (!r || r.cmpn(100) > 0) { this.redN = null; } else { this._maxwellTrick = true; this.redN = this.n.toRed(this.red); } } t.exports = f; f.prototype.point = function t() { throw new Error('Not implemented'); }; f.prototype.validate = function t() { throw new Error('Not implemented'); }; f.prototype._fixedNafMul = function t(e, r) { a(e.precomputed); var n = e._getDoubles(); var i = o(r, 1, this._bitLength); var s = (1 << (n.step + 1)) - (n.step % 2 === 0 ? 2 : 1); s /= 3; var f = []; var u; var c; for(u = 0; u < i.length; u += n.step){ c = 0; for(var l = u + n.step - 1; l >= u; l--)c = (c << 1) + i[l]; f.push(c); } var h = this.jpoint(null, null, null); var d = this.jpoint(null, null, null); for(var p = s; p > 0; p--){ for(u = 0; u < f.length; u++){ c = f[u]; if (c === p) d = d.mixedAdd(n.points[u]); else if (c === -p) d = d.mixedAdd(n.points[u].neg()); } h = h.add(d); } return h.toP(); }; f.prototype._wnafMul = function t(e, r) { var n = 4; var i = e._getNAFPoints(n); n = i.wnd; var s = i.points; var f = o(r, n, this._bitLength); var u = this.jpoint(null, null, null); for(var c = f.length - 1; c >= 0; c--){ for(var l = 0; c >= 0 && f[c] === 0; c--)l++; if (c >= 0) l++; u = u.dblp(l); if (c < 0) break; var h = f[c]; a(h !== 0); if (e.type === 'affine') { if (h > 0) u = u.mixedAdd(s[(h - 1) >> 1]); else u = u.mixedAdd(s[(-h - 1) >> 1].neg()); } else { if (h > 0) u = u.add(s[(h - 1) >> 1]); else u = u.add(s[(-h - 1) >> 1].neg()); } } return e.type === 'affine' ? u.toP() : u; }; f.prototype._wnafMulAdd = function t(e, r, n, i, a) { var f = this._wnafT1; var u = this._wnafT2; var c = this._wnafT3; var l = 0; var h; var d; var p; for(h = 0; h < i; h++){ p = r[h]; var g = p._getNAFPoints(e); f[h] = g.wnd; u[h] = g.points; } for(h = i - 1; h >= 1; h -= 2){ var b = h - 1; var v = h; if (f[b] !== 1 || f[v] !== 1) { c[b] = o(n[b], f[b], this._bitLength); c[v] = o(n[v], f[v], this._bitLength); l = Math.max(c[b].length, l); l = Math.max(c[v].length, l); continue; } var y = [ r[b], null, null, r[v] ]; if (r[b].y.cmp(r[v].y) === 0) { y[1] = r[b].add(r[v]); y[2] = r[b].toJ().mixedAdd(r[v].neg()); } else if (r[b].y.cmp(r[v].y.redNeg()) === 0) { y[1] = r[b].toJ().mixedAdd(r[v]); y[2] = r[b].add(r[v].neg()); } else { y[1] = r[b].toJ().mixedAdd(r[v]); y[2] = r[b].toJ().mixedAdd(r[v].neg()); } var m = [ -3, -1, -5, -7, 0, 7, 5, 1, 3 ]; var w = s(n[b], n[v]); l = Math.max(w[0].length, l); c[b] = new Array(l); c[v] = new Array(l); for(d = 0; d < l; d++){ var _ = w[0][d] | 0; var S = w[1][d] | 0; c[b][d] = m[(_ + 1) * 3 + (S + 1)]; c[v][d] = 0; u[b] = y; } } var E = this.jpoint(null, null, null); var x = this._wnafT4; for(h = l; h >= 0; h--){ var M = 0; while(h >= 0){ var T = true; for(d = 0; d < i; d++){ x[d] = c[d][h] | 0; if (x[d] !== 0) T = false; } if (!T) break; M++; h--; } if (h >= 0) M++; E = E.dblp(M); if (h < 0) break; for(d = 0; d < i; d++){ var A = x[d]; p; if (A === 0) continue; else if (A > 0) p = u[d][(A - 1) >> 1]; else if (A < 0) p = u[d][(-A - 1) >> 1].neg(); if (p.type === 'affine') E = E.mixedAdd(p); else E = E.add(p); } } for(h = 0; h < i; h++)u[h] = null; if (a) return E; else return E.toP(); }; function u(t, e) { this.curve = t; this.type = e; this.precomputed = null; } f.BasePoint = u; u.prototype.eq = function t() { throw new Error('Not implemented'); }; u.prototype.validate = function t() { return this.curve.validate(this); }; f.prototype.decodePoint = function t(e, r) { e = i.toArray(e, r); var n = this.p.byteLength(); if ((e[0] === 0x04 || e[0] === 0x06 || e[0] === 0x07) && e.length - 1 === 2 * n) { if (e[0] === 0x06) a(e[e.length - 1] % 2 === 0); else if (e[0] === 0x07) a(e[e.length - 1] % 2 === 1); var o = this.point(e.slice(1, 1 + n), e.slice(1 + n, 1 + 2 * n)); return o; } else if ((e[0] === 0x02 || e[0] === 0x03) && e.length - 1 === n) { return this.pointFromX(e.slice(1, 1 + n), e[0] === 0x03); } throw new Error('Unknown point format'); }; u.prototype.encodeCompressed = function t(e) { return this.encode(e, true); }; u.prototype._encode = function t(e) { var r = this.curve.p.byteLength(); var n = this.getX().toArray('be', r); if (e) return [ this.getY().isEven() ? 0x02 : 0x03 ].concat(n); return [ 0x04 ].concat(n, this.getY().toArray('be', r)); }; u.prototype.encode = function t(e, r) { return i.encode(this._encode(r), e); }; u.prototype.precompute = function t(e) { if (this.precomputed) return this; var r = { doubles: null, naf: null, beta: null }; r.naf = this._getNAFPoints(8); r.doubles = this._getDoubles(4, e); r.beta = this._getBeta(); this.precomputed = r; return this; }; u.prototype._hasDoubles = function t(e) { if (!this.precomputed) return false; var r = this.precomputed.doubles; if (!r) return false; return r.points.length >= Math.ceil((e.bitLength() + 1) / r.step); }; u.prototype._getDoubles = function t(e, r) { if (this.precomputed && this.precomputed.doubles) return this.precomputed.doubles; var n = [ this ]; var i = this; for(var o = 0; o < r; o += e){ for(var s = 0; s < e; s++)i = i.dbl(); n.push(i); } return { step: e, points: n }; }; u.prototype._getNAFPoints = function t(e) { if (this.precomputed && this.precomputed.naf) return this.precomputed.naf; var r = [ this ]; var n = (1 << e) - 1; var i = n === 1 ? null : this.dbl(); for(var o = 1; o < n; o++)r[o] = r[o - 1].add(i); return { wnd: e, points: r }; }; u.prototype._getBeta = function t() { return null; }; u.prototype.dblp = function t(e) { var r = this; for(var n = 0; n < e; n++)r = r.dbl(); return r; }; }), 1138: (function(t, e, r) { "use strict"; var n = r(953); var i = r(3550); var o = r(5717); var s = r(4918); var a = n.assert; function f(t) { this.twisted = (t.a | 0) !== 1; this.mOneA = this.twisted && (t.a | 0) === -1; this.extended = this.mOneA; s.call(this, 'edwards', t); this.a = new i(t.a, 16).umod(this.red.m); this.a = this.a.toRed(this.red); this.c = new i(t.c, 16).toRed(this.red); this.c2 = this.c.redSqr(); this.d = new i(t.d, 16).toRed(this.red); this.dd = this.d.redAdd(this.d); a(!this.twisted || this.c.fromRed().cmpn(1) === 0); this.oneC = (t.c | 0) === 1; } o(f, s); t.exports = f; f.prototype._mulA = function t(e) { if (this.mOneA) return e.redNeg(); else return this.a.redMul(e); }; f.prototype._mulC = function t(e) { if (this.oneC) return e; else return this.c.redMul(e); }; f.prototype.jpoint = function t(e, r, n, i) { return this.point(e, r, n, i); }; f.prototype.pointFromX = function t(e, r) { e = new i(e, 16); if (!e.red) e = e.toRed(this.red); var n = e.redSqr(); var o = this.c2.redSub(this.a.redMul(n)); var s = this.one.redSub(this.c2.redMul(this.d).redMul(n)); var a = o.redMul(s.redInvm()); var f = a.redSqrt(); if (f.redSqr().redSub(a).cmp(this.zero) !== 0) throw new Error('invalid point'); var u = f.fromRed().isOdd(); if (r && !u || !r && u) f = f.redNeg(); return this.point(e, f); }; f.prototype.pointFromY = function t(e, r) { e = new i(e, 16); if (!e.red) e = e.toRed(this.red); var n = e.redSqr(); var o = n.redSub(this.c2); var s = n.redMul(this.d).redMul(this.c2).redSub(this.a); var a = o.redMul(s.redInvm()); if (a.cmp(this.zero) === 0) { if (r) throw new Error('invalid point'); else return this.point(this.zero, e); } var f = a.redSqrt(); if (f.redSqr().redSub(a).cmp(this.zero) !== 0) throw new Error('invalid point'); if (f.fromRed().isOdd() !== r) f = f.redNeg(); return this.point(f, e); }; f.prototype.validate = function t(e) { if (e.isInfinity()) return true; e.normalize(); var r = e.x.redSqr(); var n = e.y.redSqr(); var i = r.redMul(this.a).redAdd(n); var o = this.c2.redMul(this.one.redAdd(this.d.redMul(r).redMul(n))); return i.cmp(o) === 0; }; function u(t, e, r, n, o) { s.BasePoint.call(this, t, 'projective'); if (e === null && r === null && n === null) { this.x = this.curve.zero; this.y = this.curve.one; this.z = this.curve.one; this.t = this.curve.zero; this.zOne = true; } else { this.x = new i(e, 16); this.y = new i(r, 16); this.z = n ? new i(n, 16) : this.curve.one; this.t = o && new i(o, 16); if (!this.x.red) this.x = this.x.toRed(this.curve.red); if (!this.y.red) this.y = this.y.toRed(this.curve.red); if (!this.z.red) this.z = this.z.toRed(this.curve.red); if (this.t && !this.t.red) this.t = this.t.toRed(this.curve.red); this.zOne = this.z === this.curve.one; if (this.curve.extended && !this.t) { this.t = this.x.redMul(this.y); if (!this.zOne) this.t = this.t.redMul(this.z.redInvm()); } } } o(u, s.BasePoint); f.prototype.pointFromJSON = function t(e) { return u.fromJSON(this, e); }; f.prototype.point = function t(e, r, n, i) { return new u(this, e, r, n, i); }; u.fromJSON = function t(e, r) { return new u(e, r[0], r[1], r[2]); }; u.prototype.inspect = function t() { if (this.isInfinity()) return ''; return ''; }; u.prototype.isInfinity = function t() { return this.x.cmpn(0) === 0 && (this.y.cmp(this.z) === 0 || (this.zOne && this.y.cmp(this.curve.c) === 0)); }; u.prototype._extDbl = function t() { var e = this.x.redSqr(); var r = this.y.redSqr(); var n = this.z.redSqr(); n = n.redIAdd(n); var i = this.curve._mulA(e); var o = this.x.redAdd(this.y).redSqr().redISub(e).redISub(r); var s = i.redAdd(r); var a = s.redSub(n); var f = i.redSub(r); var u = o.redMul(a); var c = s.redMul(f); var l = o.redMul(f); var h = a.redMul(s); return this.curve.point(u, c, h, l); }; u.prototype._projDbl = function t() { var e = this.x.redAdd(this.y).redSqr(); var r = this.x.redSqr(); var n = this.y.redSqr(); var i; var o; var s; var a; var f; var u; if (this.curve.twisted) { a = this.curve._mulA(r); var c = a.redAdd(n); if (this.zOne) { i = e.redSub(r).redSub(n).redMul(c.redSub(this.curve.two)); o = c.redMul(a.redSub(n)); s = c.redSqr().redSub(c).redSub(c); } else { f = this.z.redSqr(); u = c.redSub(f).redISub(f); i = e.redSub(r).redISub(n).redMul(u); o = c.redMul(a.redSub(n)); s = c.redMul(u); } } else { a = r.redAdd(n); f = this.curve._mulC(this.z).redSqr(); u = a.redSub(f).redSub(f); i = this.curve._mulC(e.redISub(a)).redMul(u); o = this.curve._mulC(a).redMul(r.redISub(n)); s = a.redMul(u); } return this.curve.point(i, o, s); }; u.prototype.dbl = function t() { if (this.isInfinity()) return this; if (this.curve.extended) return this._extDbl(); else return this._projDbl(); }; u.prototype._extAdd = function t(e) { var r = this.y.redSub(this.x).redMul(e.y.redSub(e.x)); var n = this.y.redAdd(this.x).redMul(e.y.redAdd(e.x)); var i = this.t.redMul(this.curve.dd).redMul(e.t); var o = this.z.redMul(e.z.redAdd(e.z)); var s = n.redSub(r); var a = o.redSub(i); var f = o.redAdd(i); var u = n.redAdd(r); var c = s.redMul(a); var l = f.redMul(u); var h = s.redMul(u); var d = a.redMul(f); return this.curve.point(c, l, d, h); }; u.prototype._projAdd = function t(e) { var r = this.z.redMul(e.z); var n = r.redSqr(); var i = this.x.redMul(e.x); var o = this.y.redMul(e.y); var s = this.curve.d.redMul(i).redMul(o); var a = n.redSub(s); var f = n.redAdd(s); var u = this.x.redAdd(this.y).redMul(e.x.redAdd(e.y)).redISub(i).redISub(o); var c = r.redMul(a).redMul(u); var l; var h; if (this.curve.twisted) { l = r.redMul(f).redMul(o.redSub(this.curve._mulA(i))); h = a.redMul(f); } else { l = r.redMul(f).redMul(o.redSub(i)); h = this.curve._mulC(a).redMul(f); } return this.curve.point(c, l, h); }; u.prototype.add = function t(e) { if (this.isInfinity()) return e; if (e.isInfinity()) return this; if (this.curve.extended) return this._extAdd(e); else return this._projAdd(e); }; u.prototype.mul = function t(e) { if (this._hasDoubles(e)) return this.curve._fixedNafMul(this, e); else return this.curve._wnafMul(this, e); }; u.prototype.mulAdd = function t(e, r, n) { return this.curve._wnafMulAdd(1, [ this, r ], [ e, n ], 2, false); }; u.prototype.jmulAdd = function t(e, r, n) { return this.curve._wnafMulAdd(1, [ this, r ], [ e, n ], 2, true); }; u.prototype.normalize = function t() { if (this.zOne) return this; var e = this.z.redInvm(); this.x = this.x.redMul(e); this.y = this.y.redMul(e); if (this.t) this.t = this.t.redMul(e); this.z = this.curve.one; this.zOne = true; return this; }; u.prototype.neg = function t() { return this.curve.point(this.x.redNeg(), this.y, this.z, this.t && this.t.redNeg()); }; u.prototype.getX = function t() { this.normalize(); return this.x.fromRed(); }; u.prototype.getY = function t() { this.normalize(); return this.y.fromRed(); }; u.prototype.eq = function t(e) { return this === e || this.getX().cmp(e.getX()) === 0 && this.getY().cmp(e.getY()) === 0; }; u.prototype.eqXToP = function t(e) { var r = e.toRed(this.curve.red).redMul(this.z); if (this.x.cmp(r) === 0) return true; var n = e.clone(); var i = this.curve.redN.redMul(this.z); for(;;){ n.iadd(this.curve.n); if (n.cmp(this.curve.p) >= 0) return false; r.redIAdd(i); if (this.x.cmp(r) === 0) return true; } }; u.prototype.toP = u.prototype.normalize; u.prototype.mixedAdd = u.prototype.add; }), 8254: (function(t, e, r) { "use strict"; var n = e; n.base = r(4918); n.short = r(6673); n.mont = r(2881); n.edwards = r(1138); }), 2881: (function(t, e, r) { "use strict"; var n = r(3550); var i = r(5717); var o = r(4918); var s = r(953); function a(t) { o.call(this, 'mont', t); this.a = new n(t.a, 16).toRed(this.red); this.b = new n(t.b, 16).toRed(this.red); this.i4 = new n(4).toRed(this.red).redInvm(); this.two = new n(2).toRed(this.red); this.a24 = this.i4.redMul(this.a.redAdd(this.two)); } i(a, o); t.exports = a; a.prototype.validate = function t(e) { var r = e.normalize().x; var n = r.redSqr(); var i = n.redMul(r).redAdd(n.redMul(this.a)).redAdd(r); var o = i.redSqrt(); return o.redSqr().cmp(i) === 0; }; function f(t, e, r) { o.BasePoint.call(this, t, 'projective'); if (e === null && r === null) { this.x = this.curve.one; this.z = this.curve.zero; } else { this.x = new n(e, 16); this.z = new n(r, 16); if (!this.x.red) this.x = this.x.toRed(this.curve.red); if (!this.z.red) this.z = this.z.toRed(this.curve.red); } } i(f, o.BasePoint); a.prototype.decodePoint = function t(e, r) { return this.point(s.toArray(e, r), 1); }; a.prototype.point = function t(e, r) { return new f(this, e, r); }; a.prototype.pointFromJSON = function t(e) { return f.fromJSON(this, e); }; f.prototype.precompute = function t() {}; f.prototype._encode = function t() { return this.getX().toArray('be', this.curve.p.byteLength()); }; f.fromJSON = function t(e, r) { return new f(e, r[0], r[1] || e.one); }; f.prototype.inspect = function t() { if (this.isInfinity()) return ''; return ''; }; f.prototype.isInfinity = function t() { return this.z.cmpn(0) === 0; }; f.prototype.dbl = function t() { var e = this.x.redAdd(this.z); var r = e.redSqr(); var n = this.x.redSub(this.z); var i = n.redSqr(); var o = r.redSub(i); var s = r.redMul(i); var a = o.redMul(i.redAdd(this.curve.a24.redMul(o))); return this.curve.point(s, a); }; f.prototype.add = function t() { throw new Error('Not supported on Montgomery curve'); }; f.prototype.diffAdd = function t(e, r) { var n = this.x.redAdd(this.z); var i = this.x.redSub(this.z); var o = e.x.redAdd(e.z); var s = e.x.redSub(e.z); var a = s.redMul(n); var f = o.redMul(i); var u = r.z.redMul(a.redAdd(f).redSqr()); var c = r.x.redMul(a.redISub(f).redSqr()); return this.curve.point(u, c); }; f.prototype.mul = function t(e) { var r = e.clone(); var n = this; var i = this.curve.point(null, null); var o = this; for(var s = []; r.cmpn(0) !== 0; r.iushrn(1))s.push(r.andln(1)); for(var a = s.length - 1; a >= 0; a--){ if (s[a] === 0) { n = n.diffAdd(i, o); i = i.dbl(); } else { i = n.diffAdd(i, o); n = n.dbl(); } } return i; }; f.prototype.mulAdd = function t() { throw new Error('Not supported on Montgomery curve'); }; f.prototype.jumlAdd = function t() { throw new Error('Not supported on Montgomery curve'); }; f.prototype.eq = function t(e) { return this.getX().cmp(e.getX()) === 0; }; f.prototype.normalize = function t() { this.x = this.x.redMul(this.z.redInvm()); this.z = this.curve.one; return this; }; f.prototype.getX = function t() { this.normalize(); return this.x.fromRed(); }; }), 6673: (function(t, e, r) { "use strict"; var n = r(953); var i = r(3550); var o = r(5717); var s = r(4918); var a = n.assert; function f(t) { s.call(this, 'short', t); this.a = new i(t.a, 16).toRed(this.red); this.b = new i(t.b, 16).toRed(this.red); this.tinv = this.two.redInvm(); this.zeroA = this.a.fromRed().cmpn(0) === 0; this.threeA = this.a.fromRed().sub(this.p).cmpn(-3) === 0; this.endo = this._getEndomorphism(t); this._endoWnafT1 = new Array(4); this._endoWnafT2 = new Array(4); } o(f, s); t.exports = f; f.prototype._getEndomorphism = function t(e) { if (!this.zeroA || !this.g || !this.n || this.p.modn(3) !== 1) return; var r; var n; if (e.beta) { r = new i(e.beta, 16).toRed(this.red); } else { var o = this._getEndoRoots(this.p); r = o[0].cmp(o[1]) < 0 ? o[0] : o[1]; r = r.toRed(this.red); } if (e.lambda) { n = new i(e.lambda, 16); } else { var s = this._getEndoRoots(this.n); if (this.g.mul(s[0]).x.cmp(this.g.x.redMul(r)) === 0) { n = s[0]; } else { n = s[1]; a(this.g.mul(n).x.cmp(this.g.x.redMul(r)) === 0); } } var f; if (e.basis) { f = e.basis.map(function(t) { return { a: new i(t.a, 16), b: new i(t.b, 16) }; }); } else { f = this._getEndoBasis(n); } return { beta: r, lambda: n, basis: f }; }; f.prototype._getEndoRoots = function t(e) { var r = e === this.p ? this.red : i.mont(e); var n = new i(2).toRed(r).redInvm(); var o = n.redNeg(); var s = new i(3).toRed(r).redNeg().redSqrt().redMul(n); var a = o.redAdd(s).fromRed(); var f = o.redSub(s).fromRed(); return [ a, f ]; }; f.prototype._getEndoBasis = function t(e) { var r = this.n.ushrn(Math.floor(this.n.bitLength() / 2)); var n = e; var o = this.n.clone(); var s = new i(1); var a = new i(0); var f = new i(0); var u = new i(1); var c; var l; var h; var d; var p; var g; var b; var v = 0; var y; var m; while(n.cmpn(0) !== 0){ var w = o.div(n); y = o.sub(w.mul(n)); m = f.sub(w.mul(s)); var _ = u.sub(w.mul(a)); if (!h && y.cmp(r) < 0) { c = b.neg(); l = s; h = y.neg(); d = m; } else if (h && ++v === 2) { break; } b = y; o = n; n = y; f = s; s = m; u = a; a = _; } p = y.neg(); g = m; var S = h.sqr().add(d.sqr()); var E = p.sqr().add(g.sqr()); if (E.cmp(S) >= 0) { p = c; g = l; } if (h.negative) { h = h.neg(); d = d.neg(); } if (p.negative) { p = p.neg(); g = g.neg(); } return [ { a: h, b: d }, { a: p, b: g } ]; }; f.prototype._endoSplit = function t(e) { var r = this.endo.basis; var n = r[0]; var i = r[1]; var o = i.b.mul(e).divRound(this.n); var s = n.b.neg().mul(e).divRound(this.n); var a = o.mul(n.a); var f = s.mul(i.a); var u = o.mul(n.b); var c = s.mul(i.b); var l = e.sub(a).sub(f); var h = u.add(c).neg(); return { k1: l, k2: h }; }; f.prototype.pointFromX = function t(e, r) { e = new i(e, 16); if (!e.red) e = e.toRed(this.red); var n = e.redSqr().redMul(e).redIAdd(e.redMul(this.a)).redIAdd(this.b); var o = n.redSqrt(); if (o.redSqr().redSub(n).cmp(this.zero) !== 0) throw new Error('invalid point'); var s = o.fromRed().isOdd(); if (r && !s || !r && s) o = o.redNeg(); return this.point(e, o); }; f.prototype.validate = function t(e) { if (e.inf) return true; var r = e.x; var n = e.y; var i = this.a.redMul(r); var o = r.redSqr().redMul(r).redIAdd(i).redIAdd(this.b); return n.redSqr().redISub(o).cmpn(0) === 0; }; f.prototype._endoWnafMulAdd = function t(e, r, n) { var i = this._endoWnafT1; var o = this._endoWnafT2; for(var s = 0; s < e.length; s++){ var a = this._endoSplit(r[s]); var f = e[s]; var u = f._getBeta(); if (a.k1.negative) { a.k1.ineg(); f = f.neg(true); } if (a.k2.negative) { a.k2.ineg(); u = u.neg(true); } i[s * 2] = f; i[s * 2 + 1] = u; o[s * 2] = a.k1; o[s * 2 + 1] = a.k2; } var c = this._wnafMulAdd(1, i, o, s * 2, n); for(var l = 0; l < s * 2; l++){ i[l] = null; o[l] = null; } return c; }; function u(t, e, r, n) { s.BasePoint.call(this, t, 'affine'); if (e === null && r === null) { this.x = null; this.y = null; this.inf = true; } else { this.x = new i(e, 16); this.y = new i(r, 16); if (n) { this.x.forceRed(this.curve.red); this.y.forceRed(this.curve.red); } if (!this.x.red) this.x = this.x.toRed(this.curve.red); if (!this.y.red) this.y = this.y.toRed(this.curve.red); this.inf = false; } } o(u, s.BasePoint); f.prototype.point = function t(e, r, n) { return new u(this, e, r, n); }; f.prototype.pointFromJSON = function t(e, r) { return u.fromJSON(this, e, r); }; u.prototype._getBeta = function t() { if (!this.curve.endo) return; var e = this.precomputed; if (e && e.beta) return e.beta; var r = this.curve.point(this.x.redMul(this.curve.endo.beta), this.y); if (e) { var n = this.curve; var i = function(t) { return n.point(t.x.redMul(n.endo.beta), t.y); }; e.beta = r; r.precomputed = { beta: null, naf: e.naf && { wnd: e.naf.wnd, points: e.naf.points.map(i) }, doubles: e.doubles && { step: e.doubles.step, points: e.doubles.points.map(i) } }; } return r; }; u.prototype.toJSON = function t() { if (!this.precomputed) return [ this.x, this.y ]; return [ this.x, this.y, this.precomputed && { doubles: this.precomputed.doubles && { step: this.precomputed.doubles.step, points: this.precomputed.doubles.points.slice(1) }, naf: this.precomputed.naf && { wnd: this.precomputed.naf.wnd, points: this.precomputed.naf.points.slice(1) } } ]; }; u.fromJSON = function t(e, r, n) { if (typeof r === 'string') r = JSON.parse(r); var i = e.point(r[0], r[1], n); if (!r[2]) return i; function o(t) { return e.point(t[0], t[1], n); } var s = r[2]; i.precomputed = { beta: null, doubles: s.doubles && { step: s.doubles.step, points: [ i ].concat(s.doubles.points.map(o)) }, naf: s.naf && { wnd: s.naf.wnd, points: [ i ].concat(s.naf.points.map(o)) } }; return i; }; u.prototype.inspect = function t() { if (this.isInfinity()) return ''; return ''; }; u.prototype.isInfinity = function t() { return this.inf; }; u.prototype.add = function t(e) { if (this.inf) return e; if (e.inf) return this; if (this.eq(e)) return this.dbl(); if (this.neg().eq(e)) return this.curve.point(null, null); if (this.x.cmp(e.x) === 0) return this.curve.point(null, null); var r = this.y.redSub(e.y); if (r.cmpn(0) !== 0) r = r.redMul(this.x.redSub(e.x).redInvm()); var n = r.redSqr().redISub(this.x).redISub(e.x); var i = r.redMul(this.x.redSub(n)).redISub(this.y); return this.curve.point(n, i); }; u.prototype.dbl = function t() { if (this.inf) return this; var e = this.y.redAdd(this.y); if (e.cmpn(0) === 0) return this.curve.point(null, null); var r = this.curve.a; var n = this.x.redSqr(); var i = e.redInvm(); var o = n.redAdd(n).redIAdd(n).redIAdd(r).redMul(i); var s = o.redSqr().redISub(this.x.redAdd(this.x)); var a = o.redMul(this.x.redSub(s)).redISub(this.y); return this.curve.point(s, a); }; u.prototype.getX = function t() { return this.x.fromRed(); }; u.prototype.getY = function t() { return this.y.fromRed(); }; u.prototype.mul = function t(e) { e = new i(e, 16); if (this.isInfinity()) return this; else if (this._hasDoubles(e)) return this.curve._fixedNafMul(this, e); else if (this.curve.endo) return this.curve._endoWnafMulAdd([ this ], [ e ]); else return this.curve._wnafMul(this, e); }; u.prototype.mulAdd = function t(e, r, n) { var i = [ this, r ]; var o = [ e, n ]; if (this.curve.endo) return this.curve._endoWnafMulAdd(i, o); else return this.curve._wnafMulAdd(1, i, o, 2); }; u.prototype.jmulAdd = function t(e, r, n) { var i = [ this, r ]; var o = [ e, n ]; if (this.curve.endo) return this.curve._endoWnafMulAdd(i, o, true); else return this.curve._wnafMulAdd(1, i, o, 2, true); }; u.prototype.eq = function t(e) { return this === e || this.inf === e.inf && (this.inf || this.x.cmp(e.x) === 0 && this.y.cmp(e.y) === 0); }; u.prototype.neg = function t(e) { if (this.inf) return this; var r = this.curve.point(this.x, this.y.redNeg()); if (e && this.precomputed) { var n = this.precomputed; var i = function(t) { return t.neg(); }; r.precomputed = { naf: n.naf && { wnd: n.naf.wnd, points: n.naf.points.map(i) }, doubles: n.doubles && { step: n.doubles.step, points: n.doubles.points.map(i) } }; } return r; }; u.prototype.toJ = function t() { if (this.inf) return this.curve.jpoint(null, null, null); var e = this.curve.jpoint(this.x, this.y, this.curve.one); return e; }; function c(t, e, r, n) { s.BasePoint.call(this, t, 'jacobian'); if (e === null && r === null && n === null) { this.x = this.curve.one; this.y = this.curve.one; this.z = new i(0); } else { this.x = new i(e, 16); this.y = new i(r, 16); this.z = new i(n, 16); } if (!this.x.red) this.x = this.x.toRed(this.curve.red); if (!this.y.red) this.y = this.y.toRed(this.curve.red); if (!this.z.red) this.z = this.z.toRed(this.curve.red); this.zOne = this.z === this.curve.one; } o(c, s.BasePoint); f.prototype.jpoint = function t(e, r, n) { return new c(this, e, r, n); }; c.prototype.toP = function t() { if (this.isInfinity()) return this.curve.point(null, null); var e = this.z.redInvm(); var r = e.redSqr(); var n = this.x.redMul(r); var i = this.y.redMul(r).redMul(e); return this.curve.point(n, i); }; c.prototype.neg = function t() { return this.curve.jpoint(this.x, this.y.redNeg(), this.z); }; c.prototype.add = function t(e) { if (this.isInfinity()) return e; if (e.isInfinity()) return this; var r = e.z.redSqr(); var n = this.z.redSqr(); var i = this.x.redMul(r); var o = e.x.redMul(n); var s = this.y.redMul(r.redMul(e.z)); var a = e.y.redMul(n.redMul(this.z)); var f = i.redSub(o); var u = s.redSub(a); if (f.cmpn(0) === 0) { if (u.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); else return this.dbl(); } var c = f.redSqr(); var l = c.redMul(f); var h = i.redMul(c); var d = u.redSqr().redIAdd(l).redISub(h).redISub(h); var p = u.redMul(h.redISub(d)).redISub(s.redMul(l)); var g = this.z.redMul(e.z).redMul(f); return this.curve.jpoint(d, p, g); }; c.prototype.mixedAdd = function t(e) { if (this.isInfinity()) return e.toJ(); if (e.isInfinity()) return this; var r = this.z.redSqr(); var n = this.x; var i = e.x.redMul(r); var o = this.y; var s = e.y.redMul(r).redMul(this.z); var a = n.redSub(i); var f = o.redSub(s); if (a.cmpn(0) === 0) { if (f.cmpn(0) !== 0) return this.curve.jpoint(null, null, null); else return this.dbl(); } var u = a.redSqr(); var c = u.redMul(a); var l = n.redMul(u); var h = f.redSqr().redIAdd(c).redISub(l).redISub(l); var d = f.redMul(l.redISub(h)).redISub(o.redMul(c)); var p = this.z.redMul(a); return this.curve.jpoint(h, d, p); }; c.prototype.dblp = function t(e) { if (e === 0) return this; if (this.isInfinity()) return this; if (!e) return this.dbl(); var r; if (this.curve.zeroA || this.curve.threeA) { var n = this; for(r = 0; r < e; r++)n = n.dbl(); return n; } var i = this.curve.a; var o = this.curve.tinv; var s = this.x; var a = this.y; var f = this.z; var u = f.redSqr().redSqr(); var c = a.redAdd(a); for(r = 0; r < e; r++){ var l = s.redSqr(); var h = c.redSqr(); var d = h.redSqr(); var p = l.redAdd(l).redIAdd(l).redIAdd(i.redMul(u)); var g = s.redMul(h); var b = p.redSqr().redISub(g.redAdd(g)); var v = g.redISub(b); var y = p.redMul(v); y = y.redIAdd(y).redISub(d); var m = c.redMul(f); if (r + 1 < e) u = u.redMul(d); s = b; f = m; c = y; } return this.curve.jpoint(s, c.redMul(o), f); }; c.prototype.dbl = function t() { if (this.isInfinity()) return this; if (this.curve.zeroA) return this._zeroDbl(); else if (this.curve.threeA) return this._threeDbl(); else return this._dbl(); }; c.prototype._zeroDbl = function t() { var e; var r; var n; if (this.zOne) { var i = this.x.redSqr(); var o = this.y.redSqr(); var s = o.redSqr(); var a = this.x.redAdd(o).redSqr().redISub(i).redISub(s); a = a.redIAdd(a); var f = i.redAdd(i).redIAdd(i); var u = f.redSqr().redISub(a).redISub(a); var c = s.redIAdd(s); c = c.redIAdd(c); c = c.redIAdd(c); e = u; r = f.redMul(a.redISub(u)).redISub(c); n = this.y.redAdd(this.y); } else { var l = this.x.redSqr(); var h = this.y.redSqr(); var d = h.redSqr(); var p = this.x.redAdd(h).redSqr().redISub(l).redISub(d); p = p.redIAdd(p); var g = l.redAdd(l).redIAdd(l); var b = g.redSqr(); var v = d.redIAdd(d); v = v.redIAdd(v); v = v.redIAdd(v); e = b.redISub(p).redISub(p); r = g.redMul(p.redISub(e)).redISub(v); n = this.y.redMul(this.z); n = n.redIAdd(n); } return this.curve.jpoint(e, r, n); }; c.prototype._threeDbl = function t() { var e; var r; var n; if (this.zOne) { var i = this.x.redSqr(); var o = this.y.redSqr(); var s = o.redSqr(); var a = this.x.redAdd(o).redSqr().redISub(i).redISub(s); a = a.redIAdd(a); var f = i.redAdd(i).redIAdd(i).redIAdd(this.curve.a); var u = f.redSqr().redISub(a).redISub(a); e = u; var c = s.redIAdd(s); c = c.redIAdd(c); c = c.redIAdd(c); r = f.redMul(a.redISub(u)).redISub(c); n = this.y.redAdd(this.y); } else { var l = this.z.redSqr(); var h = this.y.redSqr(); var d = this.x.redMul(h); var p = this.x.redSub(l).redMul(this.x.redAdd(l)); p = p.redAdd(p).redIAdd(p); var g = d.redIAdd(d); g = g.redIAdd(g); var b = g.redAdd(g); e = p.redSqr().redISub(b); n = this.y.redAdd(this.z).redSqr().redISub(h).redISub(l); var v = h.redSqr(); v = v.redIAdd(v); v = v.redIAdd(v); v = v.redIAdd(v); r = p.redMul(g.redISub(e)).redISub(v); } return this.curve.jpoint(e, r, n); }; c.prototype._dbl = function t() { var e = this.curve.a; var r = this.x; var n = this.y; var i = this.z; var o = i.redSqr().redSqr(); var s = r.redSqr(); var a = n.redSqr(); var f = s.redAdd(s).redIAdd(s).redIAdd(e.redMul(o)); var u = r.redAdd(r); u = u.redIAdd(u); var c = u.redMul(a); var l = f.redSqr().redISub(c.redAdd(c)); var h = c.redISub(l); var d = a.redSqr(); d = d.redIAdd(d); d = d.redIAdd(d); d = d.redIAdd(d); var p = f.redMul(h).redISub(d); var g = n.redAdd(n).redMul(i); return this.curve.jpoint(l, p, g); }; c.prototype.trpl = function t() { if (!this.curve.zeroA) return this.dbl().add(this); var e = this.x.redSqr(); var r = this.y.redSqr(); var n = this.z.redSqr(); var i = r.redSqr(); var o = e.redAdd(e).redIAdd(e); var s = o.redSqr(); var a = this.x.redAdd(r).redSqr().redISub(e).redISub(i); a = a.redIAdd(a); a = a.redAdd(a).redIAdd(a); a = a.redISub(s); var f = a.redSqr(); var u = i.redIAdd(i); u = u.redIAdd(u); u = u.redIAdd(u); u = u.redIAdd(u); var c = o.redIAdd(a).redSqr().redISub(s).redISub(f).redISub(u); var l = r.redMul(c); l = l.redIAdd(l); l = l.redIAdd(l); var h = this.x.redMul(f).redISub(l); h = h.redIAdd(h); h = h.redIAdd(h); var d = this.y.redMul(c.redMul(u.redISub(c)).redISub(a.redMul(f))); d = d.redIAdd(d); d = d.redIAdd(d); d = d.redIAdd(d); var p = this.z.redAdd(a).redSqr().redISub(n).redISub(f); return this.curve.jpoint(h, d, p); }; c.prototype.mul = function t(e, r) { e = new i(e, r); return this.curve._wnafMul(this, e); }; c.prototype.eq = function t(e) { if (e.type === 'affine') return this.eq(e.toJ()); if (this === e) return true; var r = this.z.redSqr(); var n = e.z.redSqr(); if (this.x.redMul(n).redISub(e.x.redMul(r)).cmpn(0) !== 0) return false; var i = r.redMul(this.z); var o = n.redMul(e.z); return this.y.redMul(o).redISub(e.y.redMul(i)).cmpn(0) === 0; }; c.prototype.eqXToP = function t(e) { var r = this.z.redSqr(); var n = e.toRed(this.curve.red).redMul(r); if (this.x.cmp(n) === 0) return true; var i = e.clone(); var o = this.curve.redN.redMul(r); for(;;){ i.iadd(this.curve.n); if (i.cmp(this.curve.p) >= 0) return false; n.redIAdd(o); if (this.x.cmp(n) === 0) return true; } }; c.prototype.inspect = function t() { if (this.isInfinity()) return ''; return ''; }; c.prototype.isInfinity = function t() { return this.z.cmpn(0) === 0; }; }), 5427: (function(t, e, r) { "use strict"; var n = e; var i = r(3715); var o = r(8254); var s = r(953); var a = s.assert; function f(t) { if (t.type === 'short') this.curve = new o.short(t); else if (t.type === 'edwards') this.curve = new o.edwards(t); else this.curve = new o.mont(t); this.g = this.curve.g; this.n = this.curve.n; this.hash = t.hash; a(this.g.validate(), 'Invalid curve'); a(this.g.mul(this.n).isInfinity(), 'Invalid curve, G*N != O'); } n.PresetCurve = f; function u(t, e) { Object.defineProperty(n, t, { configurable: true, enumerable: true, get: function() { var r = new f(e); Object.defineProperty(n, t, { configurable: true, enumerable: true, value: r }); return r; } }); } u('p192', { type: 'short', prime: 'p192', p: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff', a: 'ffffffff ffffffff ffffffff fffffffe ffffffff fffffffc', b: '64210519 e59c80e7 0fa7e9ab 72243049 feb8deec c146b9b1', n: 'ffffffff ffffffff ffffffff 99def836 146bc9b1 b4d22831', hash: i.sha256, gRed: false, g: [ '188da80e b03090f6 7cbf20eb 43a18800 f4ff0afd 82ff1012', '07192b95 ffc8da78 631011ed 6b24cdd5 73f977a1 1e794811' ] }); u('p224', { type: 'short', prime: 'p224', p: 'ffffffff ffffffff ffffffff ffffffff 00000000 00000000 00000001', a: 'ffffffff ffffffff ffffffff fffffffe ffffffff ffffffff fffffffe', b: 'b4050a85 0c04b3ab f5413256 5044b0b7 d7bfd8ba 270b3943 2355ffb4', n: 'ffffffff ffffffff ffffffff ffff16a2 e0b8f03e 13dd2945 5c5c2a3d', hash: i.sha256, gRed: false, g: [ 'b70e0cbd 6bb4bf7f 321390b9 4a03c1d3 56c21122 343280d6 115c1d21', 'bd376388 b5f723fb 4c22dfe6 cd4375a0 5a074764 44d58199 85007e34' ] }); u('p256', { type: 'short', prime: null, p: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff ffffffff', a: 'ffffffff 00000001 00000000 00000000 00000000 ffffffff ffffffff fffffffc', b: '5ac635d8 aa3a93e7 b3ebbd55 769886bc 651d06b0 cc53b0f6 3bce3c3e 27d2604b', n: 'ffffffff 00000000 ffffffff ffffffff bce6faad a7179e84 f3b9cac2 fc632551', hash: i.sha256, gRed: false, g: [ '6b17d1f2 e12c4247 f8bce6e5 63a440f2 77037d81 2deb33a0 f4a13945 d898c296', '4fe342e2 fe1a7f9b 8ee7eb4a 7c0f9e16 2bce3357 6b315ece cbb64068 37bf51f5' ] }); u('p384', { type: 'short', prime: null, p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'fffffffe ffffffff 00000000 00000000 ffffffff', a: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'fffffffe ffffffff 00000000 00000000 fffffffc', b: 'b3312fa7 e23ee7e4 988e056b e3f82d19 181d9c6e fe814112 0314088f ' + '5013875a c656398d 8a2ed19d 2a85c8ed d3ec2aef', n: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff c7634d81 ' + 'f4372ddf 581a0db2 48b0a77a ecec196a ccc52973', hash: i.sha384, gRed: false, g: [ 'aa87ca22 be8b0537 8eb1c71e f320ad74 6e1d3b62 8ba79b98 59f741e0 82542a38 ' + '5502f25d bf55296c 3a545e38 72760ab7', '3617de4a 96262c6f 5d9e98bf 9292dc29 f8f41dbd 289a147c e9da3113 b5f0b8c0 ' + '0a60b1ce 1d7e819d 7a431d7c 90ea0e5f' ] }); u('p521', { type: 'short', prime: null, p: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff ffffffff', a: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff ffffffff ffffffff fffffffc', b: '00000051 953eb961 8e1c9a1f 929a21a0 b68540ee a2da725b ' + '99b315f3 b8b48991 8ef109e1 56193951 ec7e937b 1652c0bd ' + '3bb1bf07 3573df88 3d2c34f1 ef451fd4 6b503f00', n: '000001ff ffffffff ffffffff ffffffff ffffffff ffffffff ' + 'ffffffff ffffffff fffffffa 51868783 bf2f966b 7fcc0148 ' + 'f709a5d0 3bb5c9b8 899c47ae bb6fb71e 91386409', hash: i.sha512, gRed: false, g: [ '000000c6 858e06b7 0404e9cd 9e3ecb66 2395b442 9c648139 ' + '053fb521 f828af60 6b4d3dba a14b5e77 efe75928 fe1dc127 ' + 'a2ffa8de 3348b3c1 856a429b f97e7e31 c2e5bd66', '00000118 39296a78 9a3bc004 5c8a5fb4 2c7d1bd9 98f54449 ' + '579b4468 17afbd17 273e662c 97ee7299 5ef42640 c550b901 ' + '3fad0761 353c7086 a272c240 88be9476 9fd16650' ] }); u('curve25519', { type: 'mont', prime: 'p25519', p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', a: '76d06', b: '1', n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', hash: i.sha256, gRed: false, g: [ '9' ] }); u('ed25519', { type: 'edwards', prime: 'p25519', p: '7fffffffffffffff ffffffffffffffff ffffffffffffffff ffffffffffffffed', a: '-1', c: '1', d: '52036cee2b6ffe73 8cc740797779e898 00700a4d4141d8ab 75eb4dca135978a3', n: '1000000000000000 0000000000000000 14def9dea2f79cd6 5812631a5cf5d3ed', hash: i.sha256, gRed: false, g: [ '216936d3cd6e53fec0a4e231fdd6dc5c692cc7609525a7b2c9562d608f25d51a', '6666666666666666666666666666666666666666666666666666666666666658' ] }); var c; try { c = r(1037); } catch (l) { c = undefined; } u('secp256k1', { type: 'short', prime: 'k256', p: 'ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff fffffffe fffffc2f', a: '0', b: '7', n: 'ffffffff ffffffff ffffffff fffffffe baaedce6 af48a03b bfd25e8c d0364141', h: '1', hash: i.sha256, beta: '7ae96a2b657c07106e64479eac3434e99cf0497512f58995c1396c28719501ee', lambda: '5363ad4cc05c30e0a5261c028812645a122e22ea20816678df02967c1b23bd72', basis: [ { a: '3086d221a7d46bcde86c90e49284eb15', b: '-e4437ed6010e88286f547fa90abfe4c3' }, { a: '114ca50f7a8e2f3f657c1108d9d44cfd8', b: '3086d221a7d46bcde86c90e49284eb15' } ], gRed: false, g: [ '79be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798', '483ada7726a3c4655da4fbfc0e1108a8fd17b448a68554199c47d08ffb10d4b8', c ] }); }), 7954: (function(t, e, r) { "use strict"; var n = r(3550); var i = r(2156); var o = r(953); var s = r(5427); var a = r(9931); var f = o.assert; var u = r(1251); var c = r(611); function l(t) { if (!(this instanceof l)) return new l(t); if (typeof t === 'string') { f(Object.prototype.hasOwnProperty.call(s, t), 'Unknown curve ' + t); t = s[t]; } if (t instanceof s.PresetCurve) t = { curve: t }; this.curve = t.curve.curve; this.n = this.curve.n; this.nh = this.n.ushrn(1); this.g = this.curve.g; this.g = t.curve.g; this.g.precompute(t.curve.n.bitLength() + 1); this.hash = t.hash || t.curve.hash; } t.exports = l; l.prototype.keyPair = function t(e) { return new u(this, e); }; l.prototype.keyFromPrivate = function t(e, r) { return u.fromPrivate(this, e, r); }; l.prototype.keyFromPublic = function t(e, r) { return u.fromPublic(this, e, r); }; l.prototype.genKeyPair = function t(e) { if (!e) e = {}; var r = new i({ hash: this.hash, pers: e.pers, persEnc: e.persEnc || 'utf8', entropy: e.entropy || a(this.hash.hmacStrength), entropyEnc: e.entropy && e.entropyEnc || 'utf8', nonce: this.n.toArray() }); var o = this.n.byteLength(); var s = this.n.sub(new n(2)); for(;;){ var f = new n(r.generate(o)); if (f.cmp(s) > 0) continue; f.iaddn(1); return this.keyFromPrivate(f); } }; l.prototype._truncateToN = function t(e, r) { var n = e.byteLength() * 8 - this.n.bitLength(); if (n > 0) e = e.ushrn(n); if (!r && e.cmp(this.n) >= 0) return e.sub(this.n); else return e; }; l.prototype.sign = function t(e, r, o, s) { if (typeof o === 'object') { s = o; o = null; } if (!s) s = {}; r = this.keyFromPrivate(r, o); e = this._truncateToN(new n(e, 16)); var a = this.n.byteLength(); var f = r.getPrivate().toArray('be', a); var u = e.toArray('be', a); var l = new i({ hash: this.hash, entropy: f, nonce: u, pers: s.pers, persEnc: s.persEnc || 'utf8' }); var h = this.n.sub(new n(1)); for(var d = 0;; d++){ var p = s.k ? s.k(d) : new n(l.generate(this.n.byteLength())); p = this._truncateToN(p, true); if (p.cmpn(1) <= 0 || p.cmp(h) >= 0) continue; var g = this.g.mul(p); if (g.isInfinity()) continue; var b = g.getX(); var v = b.umod(this.n); if (v.cmpn(0) === 0) continue; var y = p.invm(this.n).mul(v.mul(r.getPrivate()).iadd(e)); y = y.umod(this.n); if (y.cmpn(0) === 0) continue; var m = (g.getY().isOdd() ? 1 : 0) | (b.cmp(v) !== 0 ? 2 : 0); if (s.canonical && y.cmp(this.nh) > 0) { y = this.n.sub(y); m ^= 1; } return new c({ r: v, s: y, recoveryParam: m }); } }; l.prototype.verify = function t(e, r, i, o) { e = this._truncateToN(new n(e, 16)); i = this.keyFromPublic(i, o); r = new c(r, 'hex'); var s = r.r; var a = r.s; if (s.cmpn(1) < 0 || s.cmp(this.n) >= 0) return false; if (a.cmpn(1) < 0 || a.cmp(this.n) >= 0) return false; var f = a.invm(this.n); var u = f.mul(e).umod(this.n); var l = f.mul(s).umod(this.n); var h; if (!this.curve._maxwellTrick) { h = this.g.mulAdd(u, i.getPublic(), l); if (h.isInfinity()) return false; return h.getX().umod(this.n).cmp(s) === 0; } h = this.g.jmulAdd(u, i.getPublic(), l); if (h.isInfinity()) return false; return h.eqXToP(s); }; l.prototype.recoverPubKey = function(t, e, r, i) { f((3 & r) === r, 'The recovery param is more than two bits'); e = new c(e, i); var o = this.n; var s = new n(t); var a = e.r; var u = e.s; var l = r & 1; var h = r >> 1; if (a.cmp(this.curve.p.umod(this.curve.n)) >= 0 && h) throw new Error('Unable to find sencond key candinate'); if (h) a = this.curve.pointFromX(a.add(this.curve.n), l); else a = this.curve.pointFromX(a, l); var d = e.r.invm(o); var p = o.sub(s).mul(d).umod(o); var g = u.mul(d).umod(o); return this.g.mulAdd(p, a, g); }; l.prototype.getKeyRecoveryParam = function(t, e, r, n) { e = new c(e, n); if (e.recoveryParam !== null) return e.recoveryParam; for(var i = 0; i < 4; i++){ var o; try { o = this.recoverPubKey(t, e, i); } catch (s) { continue; } if (o.eq(r)) return i; } throw new Error('Unable to find valid recovery factor'); }; }), 1251: (function(t, e, r) { "use strict"; var n = r(3550); var i = r(953); var o = i.assert; function s(t, e) { this.ec = t; this.priv = null; this.pub = null; if (e.priv) this._importPrivate(e.priv, e.privEnc); if (e.pub) this._importPublic(e.pub, e.pubEnc); } t.exports = s; s.fromPublic = function t(e, r, n) { if (r instanceof s) return r; return new s(e, { pub: r, pubEnc: n }); }; s.fromPrivate = function t(e, r, n) { if (r instanceof s) return r; return new s(e, { priv: r, privEnc: n }); }; s.prototype.validate = function t() { var e = this.getPublic(); if (e.isInfinity()) return { result: false, reason: 'Invalid public key' }; if (!e.validate()) return { result: false, reason: 'Public key is not a point' }; if (!e.mul(this.ec.curve.n).isInfinity()) return { result: false, reason: 'Public key * N != O' }; return { result: true, reason: null }; }; s.prototype.getPublic = function t(e, r) { if (typeof e === 'string') { r = e; e = null; } if (!this.pub) this.pub = this.ec.g.mul(this.priv); if (!r) return this.pub; return this.pub.encode(r, e); }; s.prototype.getPrivate = function t(e) { if (e === 'hex') return this.priv.toString(16, 2); else return this.priv; }; s.prototype._importPrivate = function t(e, r) { this.priv = new n(e, r || 16); this.priv = this.priv.umod(this.ec.curve.n); }; s.prototype._importPublic = function t(e, r) { if (e.x || e.y) { if (this.ec.curve.type === 'mont') { o(e.x, 'Need x coordinate'); } else if (this.ec.curve.type === 'short' || this.ec.curve.type === 'edwards') { o(e.x && e.y, 'Need both x and y coordinate'); } this.pub = this.ec.curve.point(e.x, e.y); return; } this.pub = this.ec.curve.decodePoint(e, r); }; s.prototype.derive = function t(e) { if (!e.validate()) { o(e.validate(), 'public point not validated'); } return e.mul(this.priv).getX(); }; s.prototype.sign = function t(e, r, n) { return this.ec.sign(e, this, r, n); }; s.prototype.verify = function t(e, r) { return this.ec.verify(e, r, this); }; s.prototype.inspect = function t() { return ''; }; }), 611: (function(t, e, r) { "use strict"; var n = r(3550); var i = r(953); var o = i.assert; function s(t, e) { if (t instanceof s) return t; if (this._importDER(t, e)) return; o(t.r && t.s, 'Signature without r or s'); this.r = new n(t.r, 16); this.s = new n(t.s, 16); if (t.recoveryParam === undefined) this.recoveryParam = null; else this.recoveryParam = t.recoveryParam; } t.exports = s; function a() { this.place = 0; } function f(t, e) { var r = t[e.place++]; if (!(r & 0x80)) { return r; } var n = r & 0xf; if (n === 0 || n > 4) { return false; } var i = 0; for(var o = 0, s = e.place; o < n; o++, s++){ i <<= 8; i |= t[s]; i >>>= 0; } if (i <= 0x7f) { return false; } e.place = s; return i; } function u(t) { var e = 0; var r = t.length - 1; while(!t[e] && !(t[e + 1] & 0x80) && e < r){ e++; } if (e === 0) { return t; } return t.slice(e); } s.prototype._importDER = function t(e, r) { e = i.toArray(e, r); var o = new a(); if (e[o.place++] !== 0x30) { return false; } var s = f(e, o); if (s === false) { return false; } if ((s + o.place) !== e.length) { return false; } if (e[o.place++] !== 0x02) { return false; } var u = f(e, o); if (u === false) { return false; } var c = e.slice(o.place, u + o.place); o.place += u; if (e[o.place++] !== 0x02) { return false; } var l = f(e, o); if (l === false) { return false; } if (e.length !== l + o.place) { return false; } var h = e.slice(o.place, l + o.place); if (c[0] === 0) { if (c[1] & 0x80) { c = c.slice(1); } else { return false; } } if (h[0] === 0) { if (h[1] & 0x80) { h = h.slice(1); } else { return false; } } this.r = new n(c); this.s = new n(h); this.recoveryParam = null; return true; }; function c(t, e) { if (e < 0x80) { t.push(e); return; } var r = 1 + (Math.log(e) / Math.LN2 >>> 3); t.push(r | 0x80); while(--r){ t.push((e >>> (r << 3)) & 0xff); } t.push(e); } s.prototype.toDER = function t(e) { var r = this.r.toArray(); var n = this.s.toArray(); if (r[0] & 0x80) r = [ 0 ].concat(r); if (n[0] & 0x80) n = [ 0 ].concat(n); r = u(r); n = u(n); while(!n[0] && !(n[1] & 0x80)){ n = n.slice(1); } var o = [ 0x02 ]; c(o, r.length); o = o.concat(r); o.push(0x02); c(o, n.length); var s = o.concat(n); var a = [ 0x30 ]; c(a, s.length); a = a.concat(s); return i.encode(a, e); }; }), 5980: (function(t, e, r) { "use strict"; var n = r(3715); var i = r(5427); var o = r(953); var s = o.assert; var a = o.parseBytes; var f = r(9087); var u = r(3622); function c(t) { s(t === 'ed25519', 'only tested with ed25519 so far'); if (!(this instanceof c)) return new c(t); t = i[t].curve; this.curve = t; this.g = t.g; this.g.precompute(t.n.bitLength() + 1); this.pointClass = t.point().constructor; this.encodingLength = Math.ceil(t.n.bitLength() / 8); this.hash = n.sha512; } t.exports = c; c.prototype.sign = function t(e, r) { e = a(e); var n = this.keyFromSecret(r); var i = this.hashInt(n.messagePrefix(), e); var o = this.g.mul(i); var s = this.encodePoint(o); var f = this.hashInt(s, n.pubBytes(), e).mul(n.priv()); var u = i.add(f).umod(this.curve.n); return this.makeSignature({ R: o, S: u, Rencoded: s }); }; c.prototype.verify = function t(e, r, n) { e = a(e); r = this.makeSignature(r); var i = this.keyFromPublic(n); var o = this.hashInt(r.Rencoded(), i.pubBytes(), e); var s = this.g.mul(r.S()); var f = r.R().add(i.pub().mul(o)); return f.eq(s); }; c.prototype.hashInt = function t() { var e = this.hash(); for(var r = 0; r < arguments.length; r++)e.update(arguments[r]); return o.intFromLE(e.digest()).umod(this.curve.n); }; c.prototype.keyFromPublic = function t(e) { return f.fromPublic(this, e); }; c.prototype.keyFromSecret = function t(e) { return f.fromSecret(this, e); }; c.prototype.makeSignature = function t(e) { if (e instanceof u) return e; return new u(this, e); }; c.prototype.encodePoint = function t(e) { var r = e.getY().toArray('le', this.encodingLength); r[this.encodingLength - 1] |= e.getX().isOdd() ? 0x80 : 0; return r; }; c.prototype.decodePoint = function t(e) { e = o.parseBytes(e); var r = e.length - 1; var n = e.slice(0, r).concat(e[r] & ~0x80); var i = (e[r] & 0x80) !== 0; var s = o.intFromLE(n); return this.curve.pointFromY(s, i); }; c.prototype.encodeInt = function t(e) { return e.toArray('le', this.encodingLength); }; c.prototype.decodeInt = function t(e) { return o.intFromLE(e); }; c.prototype.isPoint = function t(e) { return e instanceof this.pointClass; }; }), 9087: (function(t, e, r) { "use strict"; var n = r(953); var i = n.assert; var o = n.parseBytes; var s = n.cachedProperty; function a(t, e) { this.eddsa = t; this._secret = o(e.secret); if (t.isPoint(e.pub)) this._pub = e.pub; else this._pubBytes = o(e.pub); } a.fromPublic = function t(e, r) { if (r instanceof a) return r; return new a(e, { pub: r }); }; a.fromSecret = function t(e, r) { if (r instanceof a) return r; return new a(e, { secret: r }); }; a.prototype.secret = function t() { return this._secret; }; s(a, 'pubBytes', function t() { return this.eddsa.encodePoint(this.pub()); }); s(a, 'pub', function t() { if (this._pubBytes) return this.eddsa.decodePoint(this._pubBytes); return this.eddsa.g.mul(this.priv()); }); s(a, 'privBytes', function t() { var e = this.eddsa; var r = this.hash(); var n = e.encodingLength - 1; var i = r.slice(0, e.encodingLength); i[0] &= 248; i[n] &= 127; i[n] |= 64; return i; }); s(a, 'priv', function t() { return this.eddsa.decodeInt(this.privBytes()); }); s(a, 'hash', function t() { return this.eddsa.hash().update(this.secret()).digest(); }); s(a, 'messagePrefix', function t() { return this.hash().slice(this.eddsa.encodingLength); }); a.prototype.sign = function t(e) { i(this._secret, 'KeyPair can only verify'); return this.eddsa.sign(e, this); }; a.prototype.verify = function t(e, r) { return this.eddsa.verify(e, r, this); }; a.prototype.getSecret = function t(e) { i(this._secret, 'KeyPair is public only'); return n.encode(this.secret(), e); }; a.prototype.getPublic = function t(e) { return n.encode(this.pubBytes(), e); }; t.exports = a; }), 3622: (function(t, e, r) { "use strict"; var n = r(3550); var i = r(953); var o = i.assert; var s = i.cachedProperty; var a = i.parseBytes; function f(t, e) { this.eddsa = t; if (typeof e !== 'object') e = a(e); if (Array.isArray(e)) { e = { R: e.slice(0, t.encodingLength), S: e.slice(t.encodingLength) }; } o(e.R && e.S, 'Signature without R or S'); if (t.isPoint(e.R)) this._R = e.R; if (e.S instanceof n) this._S = e.S; this._Rencoded = Array.isArray(e.R) ? e.R : e.Rencoded; this._Sencoded = Array.isArray(e.S) ? e.S : e.Sencoded; } s(f, 'S', function t() { return this.eddsa.decodeInt(this.Sencoded()); }); s(f, 'R', function t() { return this.eddsa.decodePoint(this.Rencoded()); }); s(f, 'Rencoded', function t() { return this.eddsa.encodePoint(this.R()); }); s(f, 'Sencoded', function t() { return this.eddsa.encodeInt(this.S()); }); f.prototype.toBytes = function t() { return this.Rencoded().concat(this.Sencoded()); }; f.prototype.toHex = function t() { return i.encode(this.toBytes(), 'hex').toUpperCase(); }; t.exports = f; }), 1037: (function(t) { t.exports = { doubles: { step: 4, points: [ [ 'e60fce93b59e9ec53011aabc21c23e97b2a31369b87a5ae9c44ee89e2a6dec0a', 'f7e3507399e595929db99f34f57937101296891e44d23f0be1f32cce69616821' ], [ '8282263212c609d9ea2a6e3e172de238d8c39cabd5ac1ca10646e23fd5f51508', '11f8a8098557dfe45e8256e830b60ace62d613ac2f7b17bed31b6eaff6e26caf' ], [ '175e159f728b865a72f99cc6c6fc846de0b93833fd2222ed73fce5b551e5b739', 'd3506e0d9e3c79eba4ef97a51ff71f5eacb5955add24345c6efa6ffee9fed695' ], [ '363d90d447b00c9c99ceac05b6262ee053441c7e55552ffe526bad8f83ff4640', '4e273adfc732221953b445397f3363145b9a89008199ecb62003c7f3bee9de9' ], [ '8b4b5f165df3c2be8c6244b5b745638843e4a781a15bcd1b69f79a55dffdf80c', '4aad0a6f68d308b4b3fbd7813ab0da04f9e336546162ee56b3eff0c65fd4fd36' ], [ '723cbaa6e5db996d6bf771c00bd548c7b700dbffa6c0e77bcb6115925232fcda', '96e867b5595cc498a921137488824d6e2660a0653779494801dc069d9eb39f5f' ], [ 'eebfa4d493bebf98ba5feec812c2d3b50947961237a919839a533eca0e7dd7fa', '5d9a8ca3970ef0f269ee7edaf178089d9ae4cdc3a711f712ddfd4fdae1de8999' ], [ '100f44da696e71672791d0a09b7bde459f1215a29b3c03bfefd7835b39a48db0', 'cdd9e13192a00b772ec8f3300c090666b7ff4a18ff5195ac0fbd5cd62bc65a09' ], [ 'e1031be262c7ed1b1dc9227a4a04c017a77f8d4464f3b3852c8acde6e534fd2d', '9d7061928940405e6bb6a4176597535af292dd419e1ced79a44f18f29456a00d' ], [ 'feea6cae46d55b530ac2839f143bd7ec5cf8b266a41d6af52d5e688d9094696d', 'e57c6b6c97dce1bab06e4e12bf3ecd5c981c8957cc41442d3155debf18090088' ], [ 'da67a91d91049cdcb367be4be6ffca3cfeed657d808583de33fa978bc1ec6cb1', '9bacaa35481642bc41f463f7ec9780e5dec7adc508f740a17e9ea8e27a68be1d' ], [ '53904faa0b334cdda6e000935ef22151ec08d0f7bb11069f57545ccc1a37b7c0', '5bc087d0bc80106d88c9eccac20d3c1c13999981e14434699dcb096b022771c8' ], [ '8e7bcd0bd35983a7719cca7764ca906779b53a043a9b8bcaeff959f43ad86047', '10b7770b2a3da4b3940310420ca9514579e88e2e47fd68b3ea10047e8460372a' ], [ '385eed34c1cdff21e6d0818689b81bde71a7f4f18397e6690a841e1599c43862', '283bebc3e8ea23f56701de19e9ebf4576b304eec2086dc8cc0458fe5542e5453' ], [ '6f9d9b803ecf191637c73a4413dfa180fddf84a5947fbc9c606ed86c3fac3a7', '7c80c68e603059ba69b8e2a30e45c4d47ea4dd2f5c281002d86890603a842160' ], [ '3322d401243c4e2582a2147c104d6ecbf774d163db0f5e5313b7e0e742d0e6bd', '56e70797e9664ef5bfb019bc4ddaf9b72805f63ea2873af624f3a2e96c28b2a0' ], [ '85672c7d2de0b7da2bd1770d89665868741b3f9af7643397721d74d28134ab83', '7c481b9b5b43b2eb6374049bfa62c2e5e77f17fcc5298f44c8e3094f790313a6' ], [ '948bf809b1988a46b06c9f1919413b10f9226c60f668832ffd959af60c82a0a', '53a562856dcb6646dc6b74c5d1c3418c6d4dff08c97cd2bed4cb7f88d8c8e589' ], [ '6260ce7f461801c34f067ce0f02873a8f1b0e44dfc69752accecd819f38fd8e8', 'bc2da82b6fa5b571a7f09049776a1ef7ecd292238051c198c1a84e95b2b4ae17' ], [ 'e5037de0afc1d8d43d8348414bbf4103043ec8f575bfdc432953cc8d2037fa2d', '4571534baa94d3b5f9f98d09fb990bddbd5f5b03ec481f10e0e5dc841d755bda' ], [ 'e06372b0f4a207adf5ea905e8f1771b4e7e8dbd1c6a6c5b725866a0ae4fce725', '7a908974bce18cfe12a27bb2ad5a488cd7484a7787104870b27034f94eee31dd' ], [ '213c7a715cd5d45358d0bbf9dc0ce02204b10bdde2a3f58540ad6908d0559754', '4b6dad0b5ae462507013ad06245ba190bb4850f5f36a7eeddff2c27534b458f2' ], [ '4e7c272a7af4b34e8dbb9352a5419a87e2838c70adc62cddf0cc3a3b08fbd53c', '17749c766c9d0b18e16fd09f6def681b530b9614bff7dd33e0b3941817dcaae6' ], [ 'fea74e3dbe778b1b10f238ad61686aa5c76e3db2be43057632427e2840fb27b6', '6e0568db9b0b13297cf674deccb6af93126b596b973f7b77701d3db7f23cb96f' ], [ '76e64113f677cf0e10a2570d599968d31544e179b760432952c02a4417bdde39', 'c90ddf8dee4e95cf577066d70681f0d35e2a33d2b56d2032b4b1752d1901ac01' ], [ 'c738c56b03b2abe1e8281baa743f8f9a8f7cc643df26cbee3ab150242bcbb891', '893fb578951ad2537f718f2eacbfbbbb82314eef7880cfe917e735d9699a84c3' ], [ 'd895626548b65b81e264c7637c972877d1d72e5f3a925014372e9f6588f6c14b', 'febfaa38f2bc7eae728ec60818c340eb03428d632bb067e179363ed75d7d991f' ], [ 'b8da94032a957518eb0f6433571e8761ceffc73693e84edd49150a564f676e03', '2804dfa44805a1e4d7c99cc9762808b092cc584d95ff3b511488e4e74efdf6e7' ], [ 'e80fea14441fb33a7d8adab9475d7fab2019effb5156a792f1a11778e3c0df5d', 'eed1de7f638e00771e89768ca3ca94472d155e80af322ea9fcb4291b6ac9ec78' ], [ 'a301697bdfcd704313ba48e51d567543f2a182031efd6915ddc07bbcc4e16070', '7370f91cfb67e4f5081809fa25d40f9b1735dbf7c0a11a130c0d1a041e177ea1' ], [ '90ad85b389d6b936463f9d0512678de208cc330b11307fffab7ac63e3fb04ed4', 'e507a3620a38261affdcbd9427222b839aefabe1582894d991d4d48cb6ef150' ], [ '8f68b9d2f63b5f339239c1ad981f162ee88c5678723ea3351b7b444c9ec4c0da', '662a9f2dba063986de1d90c2b6be215dbbea2cfe95510bfdf23cbf79501fff82' ], [ 'e4f3fb0176af85d65ff99ff9198c36091f48e86503681e3e6686fd5053231e11', '1e63633ad0ef4f1c1661a6d0ea02b7286cc7e74ec951d1c9822c38576feb73bc' ], [ '8c00fa9b18ebf331eb961537a45a4266c7034f2f0d4e1d0716fb6eae20eae29e', 'efa47267fea521a1a9dc343a3736c974c2fadafa81e36c54e7d2a4c66702414b' ], [ 'e7a26ce69dd4829f3e10cec0a9e98ed3143d084f308b92c0997fddfc60cb3e41', '2a758e300fa7984b471b006a1aafbb18d0a6b2c0420e83e20e8a9421cf2cfd51' ], [ 'b6459e0ee3662ec8d23540c223bcbdc571cbcb967d79424f3cf29eb3de6b80ef', '67c876d06f3e06de1dadf16e5661db3c4b3ae6d48e35b2ff30bf0b61a71ba45' ], [ 'd68a80c8280bb840793234aa118f06231d6f1fc67e73c5a5deda0f5b496943e8', 'db8ba9fff4b586d00c4b1f9177b0e28b5b0e7b8f7845295a294c84266b133120' ], [ '324aed7df65c804252dc0270907a30b09612aeb973449cea4095980fc28d3d5d', '648a365774b61f2ff130c0c35aec1f4f19213b0c7e332843967224af96ab7c84' ], [ '4df9c14919cde61f6d51dfdbe5fee5dceec4143ba8d1ca888e8bd373fd054c96', '35ec51092d8728050974c23a1d85d4b5d506cdc288490192ebac06cad10d5d' ], [ '9c3919a84a474870faed8a9c1cc66021523489054d7f0308cbfc99c8ac1f98cd', 'ddb84f0f4a4ddd57584f044bf260e641905326f76c64c8e6be7e5e03d4fc599d' ], [ '6057170b1dd12fdf8de05f281d8e06bb91e1493a8b91d4cc5a21382120a959e5', '9a1af0b26a6a4807add9a2daf71df262465152bc3ee24c65e899be932385a2a8' ], [ 'a576df8e23a08411421439a4518da31880cef0fba7d4df12b1a6973eecb94266', '40a6bf20e76640b2c92b97afe58cd82c432e10a7f514d9f3ee8be11ae1b28ec8' ], [ '7778a78c28dec3e30a05fe9629de8c38bb30d1f5cf9a3a208f763889be58ad71', '34626d9ab5a5b22ff7098e12f2ff580087b38411ff24ac563b513fc1fd9f43ac' ], [ '928955ee637a84463729fd30e7afd2ed5f96274e5ad7e5cb09eda9c06d903ac', 'c25621003d3f42a827b78a13093a95eeac3d26efa8a8d83fc5180e935bcd091f' ], [ '85d0fef3ec6db109399064f3a0e3b2855645b4a907ad354527aae75163d82751', '1f03648413a38c0be29d496e582cf5663e8751e96877331582c237a24eb1f962' ], [ 'ff2b0dce97eece97c1c9b6041798b85dfdfb6d8882da20308f5404824526087e', '493d13fef524ba188af4c4dc54d07936c7b7ed6fb90e2ceb2c951e01f0c29907' ], [ '827fbbe4b1e880ea9ed2b2e6301b212b57f1ee148cd6dd28780e5e2cf856e241', 'c60f9c923c727b0b71bef2c67d1d12687ff7a63186903166d605b68baec293ec' ], [ 'eaa649f21f51bdbae7be4ae34ce6e5217a58fdce7f47f9aa7f3b58fa2120e2b3', 'be3279ed5bbbb03ac69a80f89879aa5a01a6b965f13f7e59d47a5305ba5ad93d' ], [ 'e4a42d43c5cf169d9391df6decf42ee541b6d8f0c9a137401e23632dda34d24f', '4d9f92e716d1c73526fc99ccfb8ad34ce886eedfa8d8e4f13a7f7131deba9414' ], [ '1ec80fef360cbdd954160fadab352b6b92b53576a88fea4947173b9d4300bf19', 'aeefe93756b5340d2f3a4958a7abbf5e0146e77f6295a07b671cdc1cc107cefd' ], [ '146a778c04670c2f91b00af4680dfa8bce3490717d58ba889ddb5928366642be', 'b318e0ec3354028add669827f9d4b2870aaa971d2f7e5ed1d0b297483d83efd0' ], [ 'fa50c0f61d22e5f07e3acebb1aa07b128d0012209a28b9776d76a8793180eef9', '6b84c6922397eba9b72cd2872281a68a5e683293a57a213b38cd8d7d3f4f2811' ], [ 'da1d61d0ca721a11b1a5bf6b7d88e8421a288ab5d5bba5220e53d32b5f067ec2', '8157f55a7c99306c79c0766161c91e2966a73899d279b48a655fba0f1ad836f1' ], [ 'a8e282ff0c9706907215ff98e8fd416615311de0446f1e062a73b0610d064e13', '7f97355b8db81c09abfb7f3c5b2515888b679a3e50dd6bd6cef7c73111f4cc0c' ], [ '174a53b9c9a285872d39e56e6913cab15d59b1fa512508c022f382de8319497c', 'ccc9dc37abfc9c1657b4155f2c47f9e6646b3a1d8cb9854383da13ac079afa73' ], [ '959396981943785c3d3e57edf5018cdbe039e730e4918b3d884fdff09475b7ba', '2e7e552888c331dd8ba0386a4b9cd6849c653f64c8709385e9b8abf87524f2fd' ], [ 'd2a63a50ae401e56d645a1153b109a8fcca0a43d561fba2dbb51340c9d82b151', 'e82d86fb6443fcb7565aee58b2948220a70f750af484ca52d4142174dcf89405' ], [ '64587e2335471eb890ee7896d7cfdc866bacbdbd3839317b3436f9b45617e073', 'd99fcdd5bf6902e2ae96dd6447c299a185b90a39133aeab358299e5e9faf6589' ], [ '8481bde0e4e4d885b3a546d3e549de042f0aa6cea250e7fd358d6c86dd45e458', '38ee7b8cba5404dd84a25bf39cecb2ca900a79c42b262e556d64b1b59779057e' ], [ '13464a57a78102aa62b6979ae817f4637ffcfed3c4b1ce30bcd6303f6caf666b', '69be159004614580ef7e433453ccb0ca48f300a81d0942e13f495a907f6ecc27' ], [ 'bc4a9df5b713fe2e9aef430bcc1dc97a0cd9ccede2f28588cada3a0d2d83f366', 'd3a81ca6e785c06383937adf4b798caa6e8a9fbfa547b16d758d666581f33c1' ], [ '8c28a97bf8298bc0d23d8c749452a32e694b65e30a9472a3954ab30fe5324caa', '40a30463a3305193378fedf31f7cc0eb7ae784f0451cb9459e71dc73cbef9482' ], [ '8ea9666139527a8c1dd94ce4f071fd23c8b350c5a4bb33748c4ba111faccae0', '620efabbc8ee2782e24e7c0cfb95c5d735b783be9cf0f8e955af34a30e62b945' ], [ 'dd3625faef5ba06074669716bbd3788d89bdde815959968092f76cc4eb9a9787', '7a188fa3520e30d461da2501045731ca941461982883395937f68d00c644a573' ], [ 'f710d79d9eb962297e4f6232b40e8f7feb2bc63814614d692c12de752408221e', 'ea98e67232d3b3295d3b535532115ccac8612c721851617526ae47a9c77bfc82' ] ] }, naf: { wnd: 7, points: [ [ 'f9308a019258c31049344f85f89d5229b531c845836f99b08601f113bce036f9', '388f7b0f632de8140fe337e62a37f3566500a99934c2231b6cb9fd7584b8e672' ], [ '2f8bde4d1a07209355b4a7250a5c5128e88b84bddc619ab7cba8d569b240efe4', 'd8ac222636e5e3d6d4dba9dda6c9c426f788271bab0d6840dca87d3aa6ac62d6' ], [ '5cbdf0646e5db4eaa398f365f2ea7a0e3d419b7e0330e39ce92bddedcac4f9bc', '6aebca40ba255960a3178d6d861a54dba813d0b813fde7b5a5082628087264da' ], [ 'acd484e2f0c7f65309ad178a9f559abde09796974c57e714c35f110dfc27ccbe', 'cc338921b0a7d9fd64380971763b61e9add888a4375f8e0f05cc262ac64f9c37' ], [ '774ae7f858a9411e5ef4246b70c65aac5649980be5c17891bbec17895da008cb', 'd984a032eb6b5e190243dd56d7b7b365372db1e2dff9d6a8301d74c9c953c61b' ], [ 'f28773c2d975288bc7d1d205c3748651b075fbc6610e58cddeeddf8f19405aa8', 'ab0902e8d880a89758212eb65cdaf473a1a06da521fa91f29b5cb52db03ed81' ], [ 'd7924d4f7d43ea965a465ae3095ff41131e5946f3c85f79e44adbcf8e27e080e', '581e2872a86c72a683842ec228cc6defea40af2bd896d3a5c504dc9ff6a26b58' ], [ 'defdea4cdb677750a420fee807eacf21eb9898ae79b9768766e4faa04a2d4a34', '4211ab0694635168e997b0ead2a93daeced1f4a04a95c0f6cfb199f69e56eb77' ], [ '2b4ea0a797a443d293ef5cff444f4979f06acfebd7e86d277475656138385b6c', '85e89bc037945d93b343083b5a1c86131a01f60c50269763b570c854e5c09b7a' ], [ '352bbf4a4cdd12564f93fa332ce333301d9ad40271f8107181340aef25be59d5', '321eb4075348f534d59c18259dda3e1f4a1b3b2e71b1039c67bd3d8bcf81998c' ], [ '2fa2104d6b38d11b0230010559879124e42ab8dfeff5ff29dc9cdadd4ecacc3f', '2de1068295dd865b64569335bd5dd80181d70ecfc882648423ba76b532b7d67' ], [ '9248279b09b4d68dab21a9b066edda83263c3d84e09572e269ca0cd7f5453714', '73016f7bf234aade5d1aa71bdea2b1ff3fc0de2a887912ffe54a32ce97cb3402' ], [ 'daed4f2be3a8bf278e70132fb0beb7522f570e144bf615c07e996d443dee8729', 'a69dce4a7d6c98e8d4a1aca87ef8d7003f83c230f3afa726ab40e52290be1c55' ], [ 'c44d12c7065d812e8acf28d7cbb19f9011ecd9e9fdf281b0e6a3b5e87d22e7db', '2119a460ce326cdc76c45926c982fdac0e106e861edf61c5a039063f0e0e6482' ], [ '6a245bf6dc698504c89a20cfded60853152b695336c28063b61c65cbd269e6b4', 'e022cf42c2bd4a708b3f5126f16a24ad8b33ba48d0423b6efd5e6348100d8a82' ], [ '1697ffa6fd9de627c077e3d2fe541084ce13300b0bec1146f95ae57f0d0bd6a5', 'b9c398f186806f5d27561506e4557433a2cf15009e498ae7adee9d63d01b2396' ], [ '605bdb019981718b986d0f07e834cb0d9deb8360ffb7f61df982345ef27a7479', '2972d2de4f8d20681a78d93ec96fe23c26bfae84fb14db43b01e1e9056b8c49' ], [ '62d14dab4150bf497402fdc45a215e10dcb01c354959b10cfe31c7e9d87ff33d', '80fc06bd8cc5b01098088a1950eed0db01aa132967ab472235f5642483b25eaf' ], [ '80c60ad0040f27dade5b4b06c408e56b2c50e9f56b9b8b425e555c2f86308b6f', '1c38303f1cc5c30f26e66bad7fe72f70a65eed4cbe7024eb1aa01f56430bd57a' ], [ '7a9375ad6167ad54aa74c6348cc54d344cc5dc9487d847049d5eabb0fa03c8fb', 'd0e3fa9eca8726909559e0d79269046bdc59ea10c70ce2b02d499ec224dc7f7' ], [ 'd528ecd9b696b54c907a9ed045447a79bb408ec39b68df504bb51f459bc3ffc9', 'eecf41253136e5f99966f21881fd656ebc4345405c520dbc063465b521409933' ], [ '49370a4b5f43412ea25f514e8ecdad05266115e4a7ecb1387231808f8b45963', '758f3f41afd6ed428b3081b0512fd62a54c3f3afbb5b6764b653052a12949c9a' ], [ '77f230936ee88cbbd73df930d64702ef881d811e0e1498e2f1c13eb1fc345d74', '958ef42a7886b6400a08266e9ba1b37896c95330d97077cbbe8eb3c7671c60d6' ], [ 'f2dac991cc4ce4b9ea44887e5c7c0bce58c80074ab9d4dbaeb28531b7739f530', 'e0dedc9b3b2f8dad4da1f32dec2531df9eb5fbeb0598e4fd1a117dba703a3c37' ], [ '463b3d9f662621fb1b4be8fbbe2520125a216cdfc9dae3debcba4850c690d45b', '5ed430d78c296c3543114306dd8622d7c622e27c970a1de31cb377b01af7307e' ], [ 'f16f804244e46e2a09232d4aff3b59976b98fac14328a2d1a32496b49998f247', 'cedabd9b82203f7e13d206fcdf4e33d92a6c53c26e5cce26d6579962c4e31df6' ], [ 'caf754272dc84563b0352b7a14311af55d245315ace27c65369e15f7151d41d1', 'cb474660ef35f5f2a41b643fa5e460575f4fa9b7962232a5c32f908318a04476' ], [ '2600ca4b282cb986f85d0f1709979d8b44a09c07cb86d7c124497bc86f082120', '4119b88753c15bd6a693b03fcddbb45d5ac6be74ab5f0ef44b0be9475a7e4b40' ], [ '7635ca72d7e8432c338ec53cd12220bc01c48685e24f7dc8c602a7746998e435', '91b649609489d613d1d5e590f78e6d74ecfc061d57048bad9e76f302c5b9c61' ], [ '754e3239f325570cdbbf4a87deee8a66b7f2b33479d468fbc1a50743bf56cc18', '673fb86e5bda30fb3cd0ed304ea49a023ee33d0197a695d0c5d98093c536683' ], [ 'e3e6bd1071a1e96aff57859c82d570f0330800661d1c952f9fe2694691d9b9e8', '59c9e0bba394e76f40c0aa58379a3cb6a5a2283993e90c4167002af4920e37f5' ], [ '186b483d056a033826ae73d88f732985c4ccb1f32ba35f4b4cc47fdcf04aa6eb', '3b952d32c67cf77e2e17446e204180ab21fb8090895138b4a4a797f86e80888b' ], [ 'df9d70a6b9876ce544c98561f4be4f725442e6d2b737d9c91a8321724ce0963f', '55eb2dafd84d6ccd5f862b785dc39d4ab157222720ef9da217b8c45cf2ba2417' ], [ '5edd5cc23c51e87a497ca815d5dce0f8ab52554f849ed8995de64c5f34ce7143', 'efae9c8dbc14130661e8cec030c89ad0c13c66c0d17a2905cdc706ab7399a868' ], [ '290798c2b6476830da12fe02287e9e777aa3fba1c355b17a722d362f84614fba', 'e38da76dcd440621988d00bcf79af25d5b29c094db2a23146d003afd41943e7a' ], [ 'af3c423a95d9f5b3054754efa150ac39cd29552fe360257362dfdecef4053b45', 'f98a3fd831eb2b749a93b0e6f35cfb40c8cd5aa667a15581bc2feded498fd9c6' ], [ '766dbb24d134e745cccaa28c99bf274906bb66b26dcf98df8d2fed50d884249a', '744b1152eacbe5e38dcc887980da38b897584a65fa06cedd2c924f97cbac5996' ], [ '59dbf46f8c94759ba21277c33784f41645f7b44f6c596a58ce92e666191abe3e', 'c534ad44175fbc300f4ea6ce648309a042ce739a7919798cd85e216c4a307f6e' ], [ 'f13ada95103c4537305e691e74e9a4a8dd647e711a95e73cb62dc6018cfd87b8', 'e13817b44ee14de663bf4bc808341f326949e21a6a75c2570778419bdaf5733d' ], [ '7754b4fa0e8aced06d4167a2c59cca4cda1869c06ebadfb6488550015a88522c', '30e93e864e669d82224b967c3020b8fa8d1e4e350b6cbcc537a48b57841163a2' ], [ '948dcadf5990e048aa3874d46abef9d701858f95de8041d2a6828c99e2262519', 'e491a42537f6e597d5d28a3224b1bc25df9154efbd2ef1d2cbba2cae5347d57e' ], [ '7962414450c76c1689c7b48f8202ec37fb224cf5ac0bfa1570328a8a3d7c77ab', '100b610ec4ffb4760d5c1fc133ef6f6b12507a051f04ac5760afa5b29db83437' ], [ '3514087834964b54b15b160644d915485a16977225b8847bb0dd085137ec47ca', 'ef0afbb2056205448e1652c48e8127fc6039e77c15c2378b7e7d15a0de293311' ], [ 'd3cc30ad6b483e4bc79ce2c9dd8bc54993e947eb8df787b442943d3f7b527eaf', '8b378a22d827278d89c5e9be8f9508ae3c2ad46290358630afb34db04eede0a4' ], [ '1624d84780732860ce1c78fcbfefe08b2b29823db913f6493975ba0ff4847610', '68651cf9b6da903e0914448c6cd9d4ca896878f5282be4c8cc06e2a404078575' ], [ '733ce80da955a8a26902c95633e62a985192474b5af207da6df7b4fd5fc61cd4', 'f5435a2bd2badf7d485a4d8b8db9fcce3e1ef8e0201e4578c54673bc1dc5ea1d' ], [ '15d9441254945064cf1a1c33bbd3b49f8966c5092171e699ef258dfab81c045c', 'd56eb30b69463e7234f5137b73b84177434800bacebfc685fc37bbe9efe4070d' ], [ 'a1d0fcf2ec9de675b612136e5ce70d271c21417c9d2b8aaaac138599d0717940', 'edd77f50bcb5a3cab2e90737309667f2641462a54070f3d519212d39c197a629' ], [ 'e22fbe15c0af8ccc5780c0735f84dbe9a790badee8245c06c7ca37331cb36980', 'a855babad5cd60c88b430a69f53a1a7a38289154964799be43d06d77d31da06' ], [ '311091dd9860e8e20ee13473c1155f5f69635e394704eaa74009452246cfa9b3', '66db656f87d1f04fffd1f04788c06830871ec5a64feee685bd80f0b1286d8374' ], [ '34c1fd04d301be89b31c0442d3e6ac24883928b45a9340781867d4232ec2dbdf', '9414685e97b1b5954bd46f730174136d57f1ceeb487443dc5321857ba73abee' ], [ 'f219ea5d6b54701c1c14de5b557eb42a8d13f3abbcd08affcc2a5e6b049b8d63', '4cb95957e83d40b0f73af4544cccf6b1f4b08d3c07b27fb8d8c2962a400766d1' ], [ 'd7b8740f74a8fbaab1f683db8f45de26543a5490bca627087236912469a0b448', 'fa77968128d9c92ee1010f337ad4717eff15db5ed3c049b3411e0315eaa4593b' ], [ '32d31c222f8f6f0ef86f7c98d3a3335ead5bcd32abdd94289fe4d3091aa824bf', '5f3032f5892156e39ccd3d7915b9e1da2e6dac9e6f26e961118d14b8462e1661' ], [ '7461f371914ab32671045a155d9831ea8793d77cd59592c4340f86cbc18347b5', '8ec0ba238b96bec0cbdddcae0aa442542eee1ff50c986ea6b39847b3cc092ff6' ], [ 'ee079adb1df1860074356a25aa38206a6d716b2c3e67453d287698bad7b2b2d6', '8dc2412aafe3be5c4c5f37e0ecc5f9f6a446989af04c4e25ebaac479ec1c8c1e' ], [ '16ec93e447ec83f0467b18302ee620f7e65de331874c9dc72bfd8616ba9da6b5', '5e4631150e62fb40d0e8c2a7ca5804a39d58186a50e497139626778e25b0674d' ], [ 'eaa5f980c245f6f038978290afa70b6bd8855897f98b6aa485b96065d537bd99', 'f65f5d3e292c2e0819a528391c994624d784869d7e6ea67fb18041024edc07dc' ], [ '78c9407544ac132692ee1910a02439958ae04877151342ea96c4b6b35a49f51', 'f3e0319169eb9b85d5404795539a5e68fa1fbd583c064d2462b675f194a3ddb4' ], [ '494f4be219a1a77016dcd838431aea0001cdc8ae7a6fc688726578d9702857a5', '42242a969283a5f339ba7f075e36ba2af925ce30d767ed6e55f4b031880d562c' ], [ 'a598a8030da6d86c6bc7f2f5144ea549d28211ea58faa70ebf4c1e665c1fe9b5', '204b5d6f84822c307e4b4a7140737aec23fc63b65b35f86a10026dbd2d864e6b' ], [ 'c41916365abb2b5d09192f5f2dbeafec208f020f12570a184dbadc3e58595997', '4f14351d0087efa49d245b328984989d5caf9450f34bfc0ed16e96b58fa9913' ], [ '841d6063a586fa475a724604da03bc5b92a2e0d2e0a36acfe4c73a5514742881', '73867f59c0659e81904f9a1c7543698e62562d6744c169ce7a36de01a8d6154' ], [ '5e95bb399a6971d376026947f89bde2f282b33810928be4ded112ac4d70e20d5', '39f23f366809085beebfc71181313775a99c9aed7d8ba38b161384c746012865' ], [ '36e4641a53948fd476c39f8a99fd974e5ec07564b5315d8bf99471bca0ef2f66', 'd2424b1b1abe4eb8164227b085c9aa9456ea13493fd563e06fd51cf5694c78fc' ], [ '336581ea7bfbbb290c191a2f507a41cf5643842170e914faeab27c2c579f726', 'ead12168595fe1be99252129b6e56b3391f7ab1410cd1e0ef3dcdcabd2fda224' ], [ '8ab89816dadfd6b6a1f2634fcf00ec8403781025ed6890c4849742706bd43ede', '6fdcef09f2f6d0a044e654aef624136f503d459c3e89845858a47a9129cdd24e' ], [ '1e33f1a746c9c5778133344d9299fcaa20b0938e8acff2544bb40284b8c5fb94', '60660257dd11b3aa9c8ed618d24edff2306d320f1d03010e33a7d2057f3b3b6' ], [ '85b7c1dcb3cec1b7ee7f30ded79dd20a0ed1f4cc18cbcfcfa410361fd8f08f31', '3d98a9cdd026dd43f39048f25a8847f4fcafad1895d7a633c6fed3c35e999511' ], [ '29df9fbd8d9e46509275f4b125d6d45d7fbe9a3b878a7af872a2800661ac5f51', 'b4c4fe99c775a606e2d8862179139ffda61dc861c019e55cd2876eb2a27d84b' ], [ 'a0b1cae06b0a847a3fea6e671aaf8adfdfe58ca2f768105c8082b2e449fce252', 'ae434102edde0958ec4b19d917a6a28e6b72da1834aff0e650f049503a296cf2' ], [ '4e8ceafb9b3e9a136dc7ff67e840295b499dfb3b2133e4ba113f2e4c0e121e5', 'cf2174118c8b6d7a4b48f6d534ce5c79422c086a63460502b827ce62a326683c' ], [ 'd24a44e047e19b6f5afb81c7ca2f69080a5076689a010919f42725c2b789a33b', '6fb8d5591b466f8fc63db50f1c0f1c69013f996887b8244d2cdec417afea8fa3' ], [ 'ea01606a7a6c9cdd249fdfcfacb99584001edd28abbab77b5104e98e8e3b35d4', '322af4908c7312b0cfbfe369f7a7b3cdb7d4494bc2823700cfd652188a3ea98d' ], [ 'af8addbf2b661c8a6c6328655eb96651252007d8c5ea31be4ad196de8ce2131f', '6749e67c029b85f52a034eafd096836b2520818680e26ac8f3dfbcdb71749700' ], [ 'e3ae1974566ca06cc516d47e0fb165a674a3dabcfca15e722f0e3450f45889', '2aeabe7e4531510116217f07bf4d07300de97e4874f81f533420a72eeb0bd6a4' ], [ '591ee355313d99721cf6993ffed1e3e301993ff3ed258802075ea8ced397e246', 'b0ea558a113c30bea60fc4775460c7901ff0b053d25ca2bdeee98f1a4be5d196' ], [ '11396d55fda54c49f19aa97318d8da61fa8584e47b084945077cf03255b52984', '998c74a8cd45ac01289d5833a7beb4744ff536b01b257be4c5767bea93ea57a4' ], [ '3c5d2a1ba39c5a1790000738c9e0c40b8dcdfd5468754b6405540157e017aa7a', 'b2284279995a34e2f9d4de7396fc18b80f9b8b9fdd270f6661f79ca4c81bd257' ], [ 'cc8704b8a60a0defa3a99a7299f2e9c3fbc395afb04ac078425ef8a1793cc030', 'bdd46039feed17881d1e0862db347f8cf395b74fc4bcdc4e940b74e3ac1f1b13' ], [ 'c533e4f7ea8555aacd9777ac5cad29b97dd4defccc53ee7ea204119b2889b197', '6f0a256bc5efdf429a2fb6242f1a43a2d9b925bb4a4b3a26bb8e0f45eb596096' ], [ 'c14f8f2ccb27d6f109f6d08d03cc96a69ba8c34eec07bbcf566d48e33da6593', 'c359d6923bb398f7fd4473e16fe1c28475b740dd098075e6c0e8649113dc3a38' ], [ 'a6cbc3046bc6a450bac24789fa17115a4c9739ed75f8f21ce441f72e0b90e6ef', '21ae7f4680e889bb130619e2c0f95a360ceb573c70603139862afd617fa9b9f' ], [ '347d6d9a02c48927ebfb86c1359b1caf130a3c0267d11ce6344b39f99d43cc38', '60ea7f61a353524d1c987f6ecec92f086d565ab687870cb12689ff1e31c74448' ], [ 'da6545d2181db8d983f7dcb375ef5866d47c67b1bf31c8cf855ef7437b72656a', '49b96715ab6878a79e78f07ce5680c5d6673051b4935bd897fea824b77dc208a' ], [ 'c40747cc9d012cb1a13b8148309c6de7ec25d6945d657146b9d5994b8feb1111', '5ca560753be2a12fc6de6caf2cb489565db936156b9514e1bb5e83037e0fa2d4' ], [ '4e42c8ec82c99798ccf3a610be870e78338c7f713348bd34c8203ef4037f3502', '7571d74ee5e0fb92a7a8b33a07783341a5492144cc54bcc40a94473693606437' ], [ '3775ab7089bc6af823aba2e1af70b236d251cadb0c86743287522a1b3b0dedea', 'be52d107bcfa09d8bcb9736a828cfa7fac8db17bf7a76a2c42ad961409018cf7' ], [ 'cee31cbf7e34ec379d94fb814d3d775ad954595d1314ba8846959e3e82f74e26', '8fd64a14c06b589c26b947ae2bcf6bfa0149ef0be14ed4d80f448a01c43b1c6d' ], [ 'b4f9eaea09b6917619f6ea6a4eb5464efddb58fd45b1ebefcdc1a01d08b47986', '39e5c9925b5a54b07433a4f18c61726f8bb131c012ca542eb24a8ac07200682a' ], [ 'd4263dfc3d2df923a0179a48966d30ce84e2515afc3dccc1b77907792ebcc60e', '62dfaf07a0f78feb30e30d6295853ce189e127760ad6cf7fae164e122a208d54' ], [ '48457524820fa65a4f8d35eb6930857c0032acc0a4a2de422233eeda897612c4', '25a748ab367979d98733c38a1fa1c2e7dc6cc07db2d60a9ae7a76aaa49bd0f77' ], [ 'dfeeef1881101f2cb11644f3a2afdfc2045e19919152923f367a1767c11cceda', 'ecfb7056cf1de042f9420bab396793c0c390bde74b4bbdff16a83ae09a9a7517' ], [ '6d7ef6b17543f8373c573f44e1f389835d89bcbc6062ced36c82df83b8fae859', 'cd450ec335438986dfefa10c57fea9bcc521a0959b2d80bbf74b190dca712d10' ], [ 'e75605d59102a5a2684500d3b991f2e3f3c88b93225547035af25af66e04541f', 'f5c54754a8f71ee540b9b48728473e314f729ac5308b06938360990e2bfad125' ], [ 'eb98660f4c4dfaa06a2be453d5020bc99a0c2e60abe388457dd43fefb1ed620c', '6cb9a8876d9cb8520609af3add26cd20a0a7cd8a9411131ce85f44100099223e' ], [ '13e87b027d8514d35939f2e6892b19922154596941888336dc3563e3b8dba942', 'fef5a3c68059a6dec5d624114bf1e91aac2b9da568d6abeb2570d55646b8adf1' ], [ 'ee163026e9fd6fe017c38f06a5be6fc125424b371ce2708e7bf4491691e5764a', '1acb250f255dd61c43d94ccc670d0f58f49ae3fa15b96623e5430da0ad6c62b2' ], [ 'b268f5ef9ad51e4d78de3a750c2dc89b1e626d43505867999932e5db33af3d80', '5f310d4b3c99b9ebb19f77d41c1dee018cf0d34fd4191614003e945a1216e423' ], [ 'ff07f3118a9df035e9fad85eb6c7bfe42b02f01ca99ceea3bf7ffdba93c4750d', '438136d603e858a3a5c440c38eccbaddc1d2942114e2eddd4740d098ced1f0d8' ], [ '8d8b9855c7c052a34146fd20ffb658bea4b9f69e0d825ebec16e8c3ce2b526a1', 'cdb559eedc2d79f926baf44fb84ea4d44bcf50fee51d7ceb30e2e7f463036758' ], [ '52db0b5384dfbf05bfa9d472d7ae26dfe4b851ceca91b1eba54263180da32b63', 'c3b997d050ee5d423ebaf66a6db9f57b3180c902875679de924b69d84a7b375' ], [ 'e62f9490d3d51da6395efd24e80919cc7d0f29c3f3fa48c6fff543becbd43352', '6d89ad7ba4876b0b22c2ca280c682862f342c8591f1daf5170e07bfd9ccafa7d' ], [ '7f30ea2476b399b4957509c88f77d0191afa2ff5cb7b14fd6d8e7d65aaab1193', 'ca5ef7d4b231c94c3b15389a5f6311e9daff7bb67b103e9880ef4bff637acaec' ], [ '5098ff1e1d9f14fb46a210fada6c903fef0fb7b4a1dd1d9ac60a0361800b7a00', '9731141d81fc8f8084d37c6e7542006b3ee1b40d60dfe5362a5b132fd17ddc0' ], [ '32b78c7de9ee512a72895be6b9cbefa6e2f3c4ccce445c96b9f2c81e2778ad58', 'ee1849f513df71e32efc3896ee28260c73bb80547ae2275ba497237794c8753c' ], [ 'e2cb74fddc8e9fbcd076eef2a7c72b0ce37d50f08269dfc074b581550547a4f7', 'd3aa2ed71c9dd2247a62df062736eb0baddea9e36122d2be8641abcb005cc4a4' ], [ '8438447566d4d7bedadc299496ab357426009a35f235cb141be0d99cd10ae3a8', 'c4e1020916980a4da5d01ac5e6ad330734ef0d7906631c4f2390426b2edd791f' ], [ '4162d488b89402039b584c6fc6c308870587d9c46f660b878ab65c82c711d67e', '67163e903236289f776f22c25fb8a3afc1732f2b84b4e95dbda47ae5a0852649' ], [ '3fad3fa84caf0f34f0f89bfd2dcf54fc175d767aec3e50684f3ba4a4bf5f683d', 'cd1bc7cb6cc407bb2f0ca647c718a730cf71872e7d0d2a53fa20efcdfe61826' ], [ '674f2600a3007a00568c1a7ce05d0816c1fb84bf1370798f1c69532faeb1a86b', '299d21f9413f33b3edf43b257004580b70db57da0b182259e09eecc69e0d38a5' ], [ 'd32f4da54ade74abb81b815ad1fb3b263d82d6c692714bcff87d29bd5ee9f08f', 'f9429e738b8e53b968e99016c059707782e14f4535359d582fc416910b3eea87' ], [ '30e4e670435385556e593657135845d36fbb6931f72b08cb1ed954f1e3ce3ff6', '462f9bce619898638499350113bbc9b10a878d35da70740dc695a559eb88db7b' ], [ 'be2062003c51cc3004682904330e4dee7f3dcd10b01e580bf1971b04d4cad297', '62188bc49d61e5428573d48a74e1c655b1c61090905682a0d5558ed72dccb9bc' ], [ '93144423ace3451ed29e0fb9ac2af211cb6e84a601df5993c419859fff5df04a', '7c10dfb164c3425f5c71a3f9d7992038f1065224f72bb9d1d902a6d13037b47c' ], [ 'b015f8044f5fcbdcf21ca26d6c34fb8197829205c7b7d2a7cb66418c157b112c', 'ab8c1e086d04e813744a655b2df8d5f83b3cdc6faa3088c1d3aea1454e3a1d5f' ], [ 'd5e9e1da649d97d89e4868117a465a3a4f8a18de57a140d36b3f2af341a21b52', '4cb04437f391ed73111a13cc1d4dd0db1693465c2240480d8955e8592f27447a' ], [ 'd3ae41047dd7ca065dbf8ed77b992439983005cd72e16d6f996a5316d36966bb', 'bd1aeb21ad22ebb22a10f0303417c6d964f8cdd7df0aca614b10dc14d125ac46' ], [ '463e2763d885f958fc66cdd22800f0a487197d0a82e377b49f80af87c897b065', 'bfefacdb0e5d0fd7df3a311a94de062b26b80c61fbc97508b79992671ef7ca7f' ], [ '7985fdfd127c0567c6f53ec1bb63ec3158e597c40bfe747c83cddfc910641917', '603c12daf3d9862ef2b25fe1de289aed24ed291e0ec6708703a5bd567f32ed03' ], [ '74a1ad6b5f76e39db2dd249410eac7f99e74c59cb83d2d0ed5ff1543da7703e9', 'cc6157ef18c9c63cd6193d83631bbea0093e0968942e8c33d5737fd790e0db08' ], [ '30682a50703375f602d416664ba19b7fc9bab42c72747463a71d0896b22f6da3', '553e04f6b018b4fa6c8f39e7f311d3176290d0e0f19ca73f17714d9977a22ff8' ], [ '9e2158f0d7c0d5f26c3791efefa79597654e7a2b2464f52b1ee6c1347769ef57', '712fcdd1b9053f09003a3481fa7762e9ffd7c8ef35a38509e2fbf2629008373' ], [ '176e26989a43c9cfeba4029c202538c28172e566e3c4fce7322857f3be327d66', 'ed8cc9d04b29eb877d270b4878dc43c19aefd31f4eee09ee7b47834c1fa4b1c3' ], [ '75d46efea3771e6e68abb89a13ad747ecf1892393dfc4f1b7004788c50374da8', '9852390a99507679fd0b86fd2b39a868d7efc22151346e1a3ca4726586a6bed8' ], [ '809a20c67d64900ffb698c4c825f6d5f2310fb0451c869345b7319f645605721', '9e994980d9917e22b76b061927fa04143d096ccc54963e6a5ebfa5f3f8e286c1' ], [ '1b38903a43f7f114ed4500b4eac7083fdefece1cf29c63528d563446f972c180', '4036edc931a60ae889353f77fd53de4a2708b26b6f5da72ad3394119daf408f9' ] ] } }; }), 953: (function(t, e, r) { "use strict"; var n = e; var i = r(3550); var o = r(9746); var s = r(4504); n.assert = o; n.toArray = s.toArray; n.zero2 = s.zero2; n.toHex = s.toHex; n.encode = s.encode; function a(t, e, r) { var n = new Array(Math.max(t.bitLength(), r) + 1); n.fill(0); var i = 1 << (e + 1); var o = t.clone(); for(var s = 0; s < n.length; s++){ var a; var f = o.andln(i - 1); if (o.isOdd()) { if (f > (i >> 1) - 1) a = (i >> 1) - f; else a = f; o.isubn(a); } else { a = 0; } n[s] = a; o.iushrn(1); } return n; } n.getNAF = a; function f(t, e) { var r = [ [], [] ]; t = t.clone(); e = e.clone(); var n = 0; var i = 0; var o; while(t.cmpn(-n) > 0 || e.cmpn(-i) > 0){ var s = (t.andln(3) + n) & 3; var a = (e.andln(3) + i) & 3; if (s === 3) s = -1; if (a === 3) a = -1; var f; if ((s & 1) === 0) { f = 0; } else { o = (t.andln(7) + n) & 7; if ((o === 3 || o === 5) && a === 2) f = -s; else f = s; } r[0].push(f); var u; if ((a & 1) === 0) { u = 0; } else { o = (e.andln(7) + i) & 7; if ((o === 3 || o === 5) && s === 2) u = -a; else u = a; } r[1].push(u); if (2 * n === f + 1) n = 1 - n; if (2 * i === u + 1) i = 1 - i; t.iushrn(1); e.iushrn(1); } return r; } n.getJSF = f; function u(t, e, r) { var n = '_' + e; t.prototype[e] = function t() { return this[n] !== undefined ? this[n] : this[n] = r.call(this); }; } n.cachedProperty = u; function c(t) { return typeof t === 'string' ? n.toArray(t, 'hex') : t; } n.parseBytes = c; function l(t) { return new i(t, 'hex', 'le'); } n.intFromLE = l; }), 7187: (function(t) { "use strict"; var e = typeof Reflect === 'object' ? Reflect : null; var r = e && typeof e.apply === 'function' ? e.apply : function t(e, r, n) { return Function.prototype.apply.call(e, r, n); }; var n; if (e && typeof e.ownKeys === 'function') { n = e.ownKeys; } else if (Object.getOwnPropertySymbols) { n = function t(e) { return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e)); }; } else { n = function t(e) { return Object.getOwnPropertyNames(e); }; } function i(t) { if (console && console.warn) console.warn(t); } var o = Number.isNaN || function t(e) { return e !== e; }; function s() { s.init.call(this); } t.exports = s; t.exports.once = y; s.EventEmitter = s; s.prototype._events = undefined; s.prototype._eventsCount = 0; s.prototype._maxListeners = undefined; var a = 10; function f(t) { if (typeof t !== 'function') { throw new TypeError('The "listener" argument must be of type Function. Received type ' + typeof t); } } Object.defineProperty(s, 'defaultMaxListeners', { enumerable: true, get: function() { return a; }, set: function(t) { if (typeof t !== 'number' || t < 0 || o(t)) { throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received ' + t + '.'); } a = t; } }); s.init = function() { if (this._events === undefined || this._events === Object.getPrototypeOf(this)._events) { this._events = Object.create(null); this._eventsCount = 0; } this._maxListeners = this._maxListeners || undefined; }; s.prototype.setMaxListeners = function t(e) { if (typeof e !== 'number' || e < 0 || o(e)) { throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received ' + e + '.'); } this._maxListeners = e; return this; }; function u(t) { if (t._maxListeners === undefined) return s.defaultMaxListeners; return t._maxListeners; } s.prototype.getMaxListeners = function t() { return u(this); }; s.prototype.emit = function t(e) { var n = []; for(var i = 1; i < arguments.length; i++)n.push(arguments[i]); var o = (e === 'error'); var s = this._events; if (s !== undefined) o = (o && s.error === undefined); else if (!o) return false; if (o) { var a; if (n.length > 0) a = n[0]; if (a instanceof Error) { throw a; } var f = new Error('Unhandled error.' + (a ? ' (' + a.message + ')' : '')); f.context = a; throw f; } var u = s[e]; if (u === undefined) return false; if (typeof u === 'function') { r(u, this, n); } else { var c = u.length; var l = g(u, c); for(var i = 0; i < c; ++i)r(l[i], this, n); } return true; }; function c(t, e, r, n) { var o; var s; var a; f(r); s = t._events; if (s === undefined) { s = t._events = Object.create(null); t._eventsCount = 0; } else { if (s.newListener !== undefined) { t.emit('newListener', e, r.listener ? r.listener : r); s = t._events; } a = s[e]; } if (a === undefined) { a = s[e] = r; ++t._eventsCount; } else { if (typeof a === 'function') { a = s[e] = n ? [ r, a ] : [ a, r ]; } else if (n) { a.unshift(r); } else { a.push(r); } o = u(t); if (o > 0 && a.length > o && !a.warned) { a.warned = true; var c = new Error('Possible EventEmitter memory leak detected. ' + a.length + ' ' + String(e) + ' listeners ' + 'added. Use emitter.setMaxListeners() to ' + 'increase limit'); c.name = 'MaxListenersExceededWarning'; c.emitter = t; c.type = e; c.count = a.length; i(c); } } return t; } s.prototype.addListener = function t(e, r) { return c(this, e, r, false); }; s.prototype.on = s.prototype.addListener; s.prototype.prependListener = function t(e, r) { return c(this, e, r, true); }; function l() { if (!this.fired) { this.target.removeListener(this.type, this.wrapFn); this.fired = true; if (arguments.length === 0) return this.listener.call(this.target); return this.listener.apply(this.target, arguments); } } function h(t, e, r) { var n = { fired: false, wrapFn: undefined, target: t, type: e, listener: r }; var i = l.bind(n); i.listener = r; n.wrapFn = i; return i; } s.prototype.once = function t(e, r) { f(r); this.on(e, h(this, e, r)); return this; }; s.prototype.prependOnceListener = function t(e, r) { f(r); this.prependListener(e, h(this, e, r)); return this; }; s.prototype.removeListener = function t(e, r) { var n, i, o, s, a; f(r); i = this._events; if (i === undefined) return this; n = i[e]; if (n === undefined) return this; if (n === r || n.listener === r) { if (--this._eventsCount === 0) this._events = Object.create(null); else { delete i[e]; if (i.removeListener) this.emit('removeListener', e, n.listener || r); } } else if (typeof n !== 'function') { o = -1; for(s = n.length - 1; s >= 0; s--){ if (n[s] === r || n[s].listener === r) { a = n[s].listener; o = s; break; } } if (o < 0) return this; if (o === 0) n.shift(); else { b(n, o); } if (n.length === 1) i[e] = n[0]; if (i.removeListener !== undefined) this.emit('removeListener', e, a || r); } return this; }; s.prototype.off = s.prototype.removeListener; s.prototype.removeAllListeners = function t(e) { var r, n, i; n = this._events; if (n === undefined) return this; if (n.removeListener === undefined) { if (arguments.length === 0) { this._events = Object.create(null); this._eventsCount = 0; } else if (n[e] !== undefined) { if (--this._eventsCount === 0) this._events = Object.create(null); else delete n[e]; } return this; } if (arguments.length === 0) { var o = Object.keys(n); var s; for(i = 0; i < o.length; ++i){ s = o[i]; if (s === 'removeListener') continue; this.removeAllListeners(s); } this.removeAllListeners('removeListener'); this._events = Object.create(null); this._eventsCount = 0; return this; } r = n[e]; if (typeof r === 'function') { this.removeListener(e, r); } else if (r !== undefined) { for(i = r.length - 1; i >= 0; i--){ this.removeListener(e, r[i]); } } return this; }; function d(t, e, r) { var n = t._events; if (n === undefined) return []; var i = n[e]; if (i === undefined) return []; if (typeof i === 'function') return r ? [ i.listener || i ] : [ i ]; return r ? v(i) : g(i, i.length); } s.prototype.listeners = function t(e) { return d(this, e, true); }; s.prototype.rawListeners = function t(e) { return d(this, e, false); }; s.listenerCount = function(t, e) { if (typeof t.listenerCount === 'function') { return t.listenerCount(e); } else { return p.call(t, e); } }; s.prototype.listenerCount = p; function p(t) { var e = this._events; if (e !== undefined) { var r = e[t]; if (typeof r === 'function') { return 1; } else if (r !== undefined) { return r.length; } } return 0; } s.prototype.eventNames = function t() { return this._eventsCount > 0 ? n(this._events) : []; }; function g(t, e) { var r = new Array(e); for(var n = 0; n < e; ++n)r[n] = t[n]; return r; } function b(t, e) { for(; e + 1 < t.length; e++)t[e] = t[e + 1]; t.pop(); } function v(t) { var e = new Array(t.length); for(var r = 0; r < e.length; ++r){ e[r] = t[r].listener || t[r]; } return e; } function y(t, e) { return new Promise(function(r, n) { function i(r) { t.removeListener(e, o); n(r); } function o() { if (typeof t.removeListener === 'function') { t.removeListener('error', i); } r([].slice.call(arguments)); } ; w(t, e, o, { once: true }); if (e !== 'error') { m(t, i, { once: true }); } }); } function m(t, e, r) { if (typeof t.on === 'function') { w(t, 'error', e, r); } } function w(t, e, r, n) { if (typeof t.on === 'function') { if (n.once) { t.once(e, r); } else { t.on(e, r); } } else if (typeof t.addEventListener === 'function') { t.addEventListener(e, function i(o) { if (n.once) { t.removeEventListener(e, i); } r(o); }); } else { throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type ' + typeof t); } } }), 3346: (function(t, e, r) { (function(e, r) { true ? t.exports = r() : 0; })(this, (function() { 'use strict'; var t = Function.prototype.toString; var e = Object.create, n = Object.defineProperty, i = Object.getOwnPropertyDescriptor, o = Object.getOwnPropertyNames, s = Object.getOwnPropertySymbols, a = Object.getPrototypeOf; var f = Object.prototype, u = f.hasOwnProperty, c = f.propertyIsEnumerable; var l = typeof s === 'function'; var h = typeof WeakMap === 'function'; var d = (function() { if (h) { return function() { return new WeakMap(); }; } var t = (function() { function t() { this._keys = []; this._values = []; } t.prototype.has = function(t) { return !!~this._keys.indexOf(t); }; t.prototype.get = function(t) { return this._values[this._keys.indexOf(t)]; }; t.prototype.set = function(t, e) { this._keys.push(t); this._values.push(e); }; return t; }()); return function() { return new t(); }; })(); var p = function(r, n) { var i = r.__proto__ || a(r); if (!i) { return e(null); } var o = i.constructor; if (o === n.Object) { return i === n.Object.prototype ? {} : e(i); } if (~t.call(o).indexOf('[native code]')) { try { return new o(); } catch (s) {} } return e(i); }; var g = function(t, e, r, n) { var i = p(t, e); n.set(t, i); for(var o in t){ if (u.call(t, o)) { i[o] = r(t[o], n); } } if (l) { var a = s(t); for(var f = 0, h = a.length, d = void 0; f < h; ++f){ d = a[f]; if (c.call(t, d)) { i[d] = r(t[d], n); } } } return i; }; var b = function(t, e, r, a) { var f = p(t, e); a.set(t, f); var u = l ? o(t).concat(s(t)) : o(t); for(var c = 0, h = u.length, d = void 0, g = void 0; c < h; ++c){ d = u[c]; if (d !== 'callee' && d !== 'caller') { g = i(t, d); if (g) { if (!g.get && !g.set) { g.value = r(t[d], a); } try { n(f, d, g); } catch (b) { f[d] = g.value; } } else { f[d] = r(t[d], a); } } } return f; }; var v = function(t) { var e = ''; if (t.global) { e += 'g'; } if (t.ignoreCase) { e += 'i'; } if (t.multiline) { e += 'm'; } if (t.unicode) { e += 'u'; } if (t.sticky) { e += 'y'; } return e; }; var y = Array.isArray; var m = Object.getPrototypeOf; var w = (function() { if (typeof globalThis !== 'undefined') { return globalThis; } if (typeof self !== 'undefined') { return self; } if (typeof window !== 'undefined') { return window; } if (typeof r.g !== 'undefined') { return r.g; } if (console && console.error) { console.error('Unable to locate global object, returning "this".'); } return this; })(); function _(t, e) { var r = !!(e && e.isStrict); var n = (e && e.realm) || w; var i = r ? b : g; var o = function(t, e) { if (!t || typeof t !== 'object') { return t; } if (e.has(t)) { return e.get(t); } var s = t.__proto__ || m(t); var a = s && s.constructor; if (!a || a === n.Object) { return i(t, n, o, e); } var f; if (y(t)) { if (r) { return b(t, n, o, e); } f = new a(); e.set(t, f); for(var u = 0, c = t.length; u < c; ++u){ f[u] = o(t[u], e); } return f; } if (t instanceof n.Date) { return new a(t.getTime()); } if (t instanceof n.RegExp) { f = new a(t.source, t.flags || v(t)); f.lastIndex = t.lastIndex; return f; } if (n.Map && t instanceof n.Map) { f = new a(); e.set(t, f); t.forEach(function(t, r) { f.set(r, o(t, e)); }); return f; } if (n.Set && t instanceof n.Set) { f = new a(); e.set(t, f); t.forEach(function(t) { f.add(o(t, e)); }); return f; } if (n.Blob && t instanceof n.Blob) { return t.slice(0, t.size, t.type); } if (n.Buffer && n.Buffer.isBuffer(t)) { f = n.Buffer.allocUnsafe ? n.Buffer.allocUnsafe(t.length) : new a(t.length); e.set(t, f); t.copy(f); return f; } if (n.ArrayBuffer) { if (n.ArrayBuffer.isView(t)) { f = new a(t.buffer.slice(0)); e.set(t, f); return f; } if (t instanceof n.ArrayBuffer) { f = t.slice(0); e.set(t, f); return f; } } if (typeof t.then === 'function' || t instanceof Error || (n.WeakMap && t instanceof n.WeakMap) || (n.WeakSet && t instanceof n.WeakSet)) { return t; } return i(t, n, o, e); }; return o(t, d()); } _.default = _; _.strict = function t(e, r) { return _(e, { isStrict: true, realm: r ? r.realm : void 0 }); }; return _; })); }), 4029: (function(t, e, r) { "use strict"; var n = r(5320); var i = Object.prototype.toString; var o = Object.prototype.hasOwnProperty; var s = function t(e, r, n) { for(var i = 0, s = e.length; i < s; i++){ if (o.call(e, i)) { if (n == null) { r(e[i], i, e); } else { r.call(n, e[i], i, e); } } } }; var a = function t(e, r, n) { for(var i = 0, o = e.length; i < o; i++){ if (n == null) { r(e.charAt(i), i, e); } else { r.call(n, e.charAt(i), i, e); } } }; var f = function t(e, r, n) { for(var i in e){ if (o.call(e, i)) { if (n == null) { r(e[i], i, e); } else { r.call(n, e[i], i, e); } } } }; var u = function t(e, r, o) { if (!n(r)) { throw new TypeError('iterator must be a function'); } var u; if (arguments.length >= 3) { u = o; } if (i.call(e) === '[object Array]') { s(e, r, u); } else if (typeof e === 'string') { a(e, r, u); } else { f(e, r, u); } }; t.exports = u; }), 7648: (function(t) { "use strict"; var e = 'Function.prototype.bind called on incompatible '; var r = Array.prototype.slice; var n = Object.prototype.toString; var i = '[object Function]'; t.exports = function t(o) { var s = this; if (typeof s !== 'function' || n.call(s) !== i) { throw new TypeError(e + s); } var a = r.call(arguments, 1); var f; var u = function() { if (this instanceof f) { var t = s.apply(this, a.concat(r.call(arguments))); if (Object(t) === t) { return t; } return this; } else { return s.apply(o, a.concat(r.call(arguments))); } }; var c = Math.max(0, s.length - a.length); var l = []; for(var h = 0; h < c; h++){ l.push('$' + h); } f = Function('binder', 'return function (' + l.join(',') + '){ return binder.apply(this,arguments); }')(u); if (s.prototype) { var d = function t() {}; d.prototype = s.prototype; f.prototype = new d(); d.prototype = null; } return f; }; }), 8612: (function(t, e, r) { "use strict"; var n = r(7648); t.exports = Function.prototype.bind || n; }), 4977: (function(t) { "use strict"; t.exports = v; var e = 0; var r = 1; function n(t, e, r, n, i, o) { this._color = t; this.key = e; this.value = r; this.left = n; this.right = i; this._count = o; } function i(t) { return new n(t._color, t.key, t.value, t.left, t.right, t._count); } function o(t, e) { return new n(t, e.key, e.value, e.left, e.right, e._count); } function s(t) { t._count = 1 + (t.left ? t.left._count : 0) + (t.right ? t.right._count : 0); } function a(t, e) { this._compare = t; this.root = e; } var f = a.prototype; Object.defineProperty(f, "keys", { get: function() { var t = []; this.forEach(function(e, r) { t.push(e); }); return t; } }); Object.defineProperty(f, "values", { get: function() { var t = []; this.forEach(function(e, r) { t.push(r); }); return t; } }); Object.defineProperty(f, "length", { get: function() { if (this.root) { return this.root._count; } return 0; } }); f.insert = function(t, i) { var f = this._compare; var u = this.root; var c = []; var l = []; while(u){ var h = f(t, u.key); c.push(u); l.push(h); if (h <= 0) { u = u.left; } else { u = u.right; } } c.push(new n(e, t, i, null, null, 1)); for(var d = c.length - 2; d >= 0; --d){ var u = c[d]; if (l[d] <= 0) { c[d] = new n(u._color, u.key, u.value, c[d + 1], u.right, u._count + 1); } else { c[d] = new n(u._color, u.key, u.value, u.left, c[d + 1], u._count + 1); } } for(var d = c.length - 1; d > 1; --d){ var p = c[d - 1]; var u = c[d]; if (p._color === r || u._color === r) { break; } var g = c[d - 2]; if (g.left === p) { if (p.left === u) { var b = g.right; if (b && b._color === e) { p._color = r; g.right = o(r, b); g._color = e; d -= 1; } else { g._color = e; g.left = p.right; p._color = r; p.right = g; c[d - 2] = p; c[d - 1] = u; s(g); s(p); if (d >= 3) { var v = c[d - 3]; if (v.left === g) { v.left = p; } else { v.right = p; } } break; } } else { var b = g.right; if (b && b._color === e) { p._color = r; g.right = o(r, b); g._color = e; d -= 1; } else { p.right = u.left; g._color = e; g.left = u.right; u._color = r; u.left = p; u.right = g; c[d - 2] = u; c[d - 1] = p; s(g); s(p); s(u); if (d >= 3) { var v = c[d - 3]; if (v.left === g) { v.left = u; } else { v.right = u; } } break; } } } else { if (p.right === u) { var b = g.left; if (b && b._color === e) { p._color = r; g.left = o(r, b); g._color = e; d -= 1; } else { g._color = e; g.right = p.left; p._color = r; p.left = g; c[d - 2] = p; c[d - 1] = u; s(g); s(p); if (d >= 3) { var v = c[d - 3]; if (v.right === g) { v.right = p; } else { v.left = p; } } break; } } else { var b = g.left; if (b && b._color === e) { p._color = r; g.left = o(r, b); g._color = e; d -= 1; } else { p.left = u.right; g._color = e; g.right = u.left; u._color = r; u.right = p; u.left = g; c[d - 2] = u; c[d - 1] = p; s(g); s(p); s(u); if (d >= 3) { var v = c[d - 3]; if (v.right === g) { v.right = u; } else { v.left = u; } } break; } } } } c[0]._color = r; return new a(f, c[0]); }; function u(t, e) { if (e.left) { var r = u(t, e.left); if (r) { return r; } } var r = t(e.key, e.value); if (r) { return r; } if (e.right) { return u(t, e.right); } } function c(t, e, r, n) { var i = e(t, n.key); if (i <= 0) { if (n.left) { var o = c(t, e, r, n.left); if (o) { return o; } } var o = r(n.key, n.value); if (o) { return o; } } if (n.right) { return c(t, e, r, n.right); } } function l(t, e, r, n, i) { var o = r(t, i.key); var s = r(e, i.key); var a; if (o <= 0) { if (i.left) { a = l(t, e, r, n, i.left); if (a) { return a; } } if (s > 0) { a = n(i.key, i.value); if (a) { return a; } } } if (s > 0 && i.right) { return l(t, e, r, n, i.right); } } f.forEach = function t(e, r, n) { if (!this.root) { return; } switch(arguments.length){ case 1: return u(e, this.root); break; case 2: return c(r, this._compare, e, this.root); break; case 3: if (this._compare(r, n) >= 0) { return; } return l(r, n, this._compare, e, this.root); break; } }; Object.defineProperty(f, "begin", { get: function() { var t = []; var e = this.root; while(e){ t.push(e); e = e.left; } return new h(this, t); } }); Object.defineProperty(f, "end", { get: function() { var t = []; var e = this.root; while(e){ t.push(e); e = e.right; } return new h(this, t); } }); f.at = function(t) { if (t < 0) { return new h(this, []); } var e = this.root; var r = []; while(true){ r.push(e); if (e.left) { if (t < e.left._count) { e = e.left; continue; } t -= e.left._count; } if (!t) { return new h(this, r); } t -= 1; if (e.right) { if (t >= e.right._count) { break; } e = e.right; } else { break; } } return new h(this, []); }; f.ge = function(t) { var e = this._compare; var r = this.root; var n = []; var i = 0; while(r){ var o = e(t, r.key); n.push(r); if (o <= 0) { i = n.length; } if (o <= 0) { r = r.left; } else { r = r.right; } } n.length = i; return new h(this, n); }; f.gt = function(t) { var e = this._compare; var r = this.root; var n = []; var i = 0; while(r){ var o = e(t, r.key); n.push(r); if (o < 0) { i = n.length; } if (o < 0) { r = r.left; } else { r = r.right; } } n.length = i; return new h(this, n); }; f.lt = function(t) { var e = this._compare; var r = this.root; var n = []; var i = 0; while(r){ var o = e(t, r.key); n.push(r); if (o > 0) { i = n.length; } if (o <= 0) { r = r.left; } else { r = r.right; } } n.length = i; return new h(this, n); }; f.le = function(t) { var e = this._compare; var r = this.root; var n = []; var i = 0; while(r){ var o = e(t, r.key); n.push(r); if (o >= 0) { i = n.length; } if (o < 0) { r = r.left; } else { r = r.right; } } n.length = i; return new h(this, n); }; f.find = function(t) { var e = this._compare; var r = this.root; var n = []; while(r){ var i = e(t, r.key); n.push(r); if (i === 0) { return new h(this, n); } if (i <= 0) { r = r.left; } else { r = r.right; } } return new h(this, []); }; f.remove = function(t) { var e = this.find(t); if (e) { return e.remove(); } return this; }; f.get = function(t) { var e = this._compare; var r = this.root; while(r){ var n = e(t, r.key); if (n === 0) { return r.value; } if (n <= 0) { r = r.left; } else { r = r.right; } } return; }; function h(t, e) { this.tree = t; this._stack = e; } var d = h.prototype; Object.defineProperty(d, "valid", { get: function() { return this._stack.length > 0; } }); Object.defineProperty(d, "node", { get: function() { if (this._stack.length > 0) { return this._stack[this._stack.length - 1]; } return null; }, enumerable: true }); d.clone = function() { return new h(this.tree, this._stack.slice()); }; function p(t, e) { t.key = e.key; t.value = e.value; t.left = e.left; t.right = e.right; t._color = e._color; t._count = e._count; } function g(t) { var n, a, f, u; for(var c = t.length - 1; c >= 0; --c){ n = t[c]; if (c === 0) { n._color = r; return; } a = t[c - 1]; if (a.left === n) { f = a.right; if (f.right && f.right._color === e) { f = a.right = i(f); u = f.right = i(f.right); a.right = f.left; f.left = a; f.right = u; f._color = a._color; n._color = r; a._color = r; u._color = r; s(a); s(f); if (c > 1) { var l = t[c - 2]; if (l.left === a) { l.left = f; } else { l.right = f; } } t[c - 1] = f; return; } else if (f.left && f.left._color === e) { f = a.right = i(f); u = f.left = i(f.left); a.right = u.left; f.left = u.right; u.left = a; u.right = f; u._color = a._color; a._color = r; f._color = r; n._color = r; s(a); s(f); s(u); if (c > 1) { var l = t[c - 2]; if (l.left === a) { l.left = u; } else { l.right = u; } } t[c - 1] = u; return; } if (f._color === r) { if (a._color === e) { a._color = r; a.right = o(e, f); return; } else { a.right = o(e, f); continue; } } else { f = i(f); a.right = f.left; f.left = a; f._color = a._color; a._color = e; s(a); s(f); if (c > 1) { var l = t[c - 2]; if (l.left === a) { l.left = f; } else { l.right = f; } } t[c - 1] = f; t[c] = a; if (c + 1 < t.length) { t[c + 1] = n; } else { t.push(n); } c = c + 2; } } else { f = a.left; if (f.left && f.left._color === e) { f = a.left = i(f); u = f.left = i(f.left); a.left = f.right; f.right = a; f.left = u; f._color = a._color; n._color = r; a._color = r; u._color = r; s(a); s(f); if (c > 1) { var l = t[c - 2]; if (l.right === a) { l.right = f; } else { l.left = f; } } t[c - 1] = f; return; } else if (f.right && f.right._color === e) { f = a.left = i(f); u = f.right = i(f.right); a.left = u.right; f.right = u.left; u.right = a; u.left = f; u._color = a._color; a._color = r; f._color = r; n._color = r; s(a); s(f); s(u); if (c > 1) { var l = t[c - 2]; if (l.right === a) { l.right = u; } else { l.left = u; } } t[c - 1] = u; return; } if (f._color === r) { if (a._color === e) { a._color = r; a.left = o(e, f); return; } else { a.left = o(e, f); continue; } } else { f = i(f); a.left = f.right; f.right = a; f._color = a._color; a._color = e; s(a); s(f); if (c > 1) { var l = t[c - 2]; if (l.right === a) { l.right = f; } else { l.left = f; } } t[c - 1] = f; t[c] = a; if (c + 1 < t.length) { t[c + 1] = n; } else { t.push(n); } c = c + 2; } } } } d.remove = function() { var t = this._stack; if (t.length === 0) { return this.tree; } var i = new Array(t.length); var o = t[t.length - 1]; i[i.length - 1] = new n(o._color, o.key, o.value, o.left, o.right, o._count); for(var s = t.length - 2; s >= 0; --s){ var o = t[s]; if (o.left === t[s + 1]) { i[s] = new n(o._color, o.key, o.value, i[s + 1], o.right, o._count); } else { i[s] = new n(o._color, o.key, o.value, o.left, i[s + 1], o._count); } } o = i[i.length - 1]; if (o.left && o.right) { var f = i.length; o = o.left; while(o.right){ i.push(o); o = o.right; } var u = i[f - 1]; i.push(new n(o._color, u.key, u.value, o.left, o.right, o._count)); i[f - 1].key = o.key; i[f - 1].value = o.value; for(var s = i.length - 2; s >= f; --s){ o = i[s]; i[s] = new n(o._color, o.key, o.value, o.left, i[s + 1], o._count); } i[f - 1].left = i[f]; } o = i[i.length - 1]; if (o._color === e) { var c = i[i.length - 2]; if (c.left === o) { c.left = null; } else if (c.right === o) { c.right = null; } i.pop(); for(var s = 0; s < i.length; ++s){ i[s]._count--; } return new a(this.tree._compare, i[0]); } else { if (o.left || o.right) { if (o.left) { p(o, o.left); } else if (o.right) { p(o, o.right); } o._color = r; for(var s = 0; s < i.length - 1; ++s){ i[s]._count--; } return new a(this.tree._compare, i[0]); } else if (i.length === 1) { return new a(this.tree._compare, null); } else { for(var s = 0; s < i.length; ++s){ i[s]._count--; } var l = i[i.length - 2]; g(i); if (l.left === o) { l.left = null; } else { l.right = null; } } } return new a(this.tree._compare, i[0]); }; Object.defineProperty(d, "key", { get: function() { if (this._stack.length > 0) { return this._stack[this._stack.length - 1].key; } return; }, enumerable: true }); Object.defineProperty(d, "value", { get: function() { if (this._stack.length > 0) { return this._stack[this._stack.length - 1].value; } return; }, enumerable: true }); Object.defineProperty(d, "index", { get: function() { var t = 0; var e = this._stack; if (e.length === 0) { var r = this.tree.root; if (r) { return r._count; } return 0; } else if (e[e.length - 1].left) { t = e[e.length - 1].left._count; } for(var n = e.length - 2; n >= 0; --n){ if (e[n + 1] === e[n].right) { ++t; if (e[n].left) { t += e[n].left._count; } } } return t; }, enumerable: true }); d.next = function() { var t = this._stack; if (t.length === 0) { return; } var e = t[t.length - 1]; if (e.right) { e = e.right; while(e){ t.push(e); e = e.left; } } else { t.pop(); while(t.length > 0 && t[t.length - 1].right === e){ e = t[t.length - 1]; t.pop(); } } }; Object.defineProperty(d, "hasNext", { get: function() { var t = this._stack; if (t.length === 0) { return false; } if (t[t.length - 1].right) { return true; } for(var e = t.length - 1; e > 0; --e){ if (t[e - 1].left === t[e]) { return true; } } return false; } }); d.update = function(t) { var e = this._stack; if (e.length === 0) { throw new Error("Can't update empty node!"); } var r = new Array(e.length); var i = e[e.length - 1]; r[r.length - 1] = new n(i._color, i.key, t, i.left, i.right, i._count); for(var o = e.length - 2; o >= 0; --o){ i = e[o]; if (i.left === e[o + 1]) { r[o] = new n(i._color, i.key, i.value, r[o + 1], i.right, i._count); } else { r[o] = new n(i._color, i.key, i.value, i.left, r[o + 1], i._count); } } return new a(this.tree._compare, r[0]); }; d.prev = function() { var t = this._stack; if (t.length === 0) { return; } var e = t[t.length - 1]; if (e.left) { e = e.left; while(e){ t.push(e); e = e.right; } } else { t.pop(); while(t.length > 0 && t[t.length - 1].left === e){ e = t[t.length - 1]; t.pop(); } } }; Object.defineProperty(d, "hasPrev", { get: function() { var t = this._stack; if (t.length === 0) { return false; } if (t[t.length - 1].left) { return true; } for(var e = t.length - 1; e > 0; --e){ if (t[e - 1].right === t[e]) { return true; } } return false; } }); function b(t, e) { if (t < e) { return -1; } if (t > e) { return 1; } return 0; } function v(t) { return new a(t || b, null); } }), 210: (function(module, __unused_webpack_exports, __webpack_require__) { "use strict"; var undefined; var $SyntaxError = SyntaxError; var $Function = Function; var $TypeError = TypeError; var getEvalledConstructor = function(t) { try { return $Function('"use strict"; return (' + t + ').constructor;')(); } catch (e) {} }; var $gOPD = Object.getOwnPropertyDescriptor; if ($gOPD) { try { $gOPD({}, ''); } catch (e) { $gOPD = null; } } var throwTypeError = function() { throw new $TypeError(); }; var ThrowTypeError = $gOPD ? (function() { try { arguments.callee; return throwTypeError; } catch (e) { try { return $gOPD(arguments, 'callee').get; } catch (t) { return throwTypeError; } } }()) : throwTypeError; var hasSymbols = __webpack_require__(1405)(); var getProto = Object.getPrototypeOf || function(t) { return t.__proto__; }; var needsEval = {}; var TypedArray = typeof Uint8Array === 'undefined' ? undefined : getProto(Uint8Array); var INTRINSICS = { '%AggregateError%': typeof AggregateError === 'undefined' ? undefined : AggregateError, '%Array%': Array, '%ArrayBuffer%': typeof ArrayBuffer === 'undefined' ? undefined : ArrayBuffer, '%ArrayIteratorPrototype%': hasSymbols ? getProto([][Symbol.iterator]()) : undefined, '%AsyncFromSyncIteratorPrototype%': undefined, '%AsyncFunction%': needsEval, '%AsyncGenerator%': needsEval, '%AsyncGeneratorFunction%': needsEval, '%AsyncIteratorPrototype%': needsEval, '%Atomics%': typeof Atomics === 'undefined' ? undefined : Atomics, '%BigInt%': typeof BigInt === 'undefined' ? undefined : BigInt, '%Boolean%': Boolean, '%DataView%': typeof DataView === 'undefined' ? undefined : DataView, '%Date%': Date, '%decodeURI%': decodeURI, '%decodeURIComponent%': decodeURIComponent, '%encodeURI%': encodeURI, '%encodeURIComponent%': encodeURIComponent, '%Error%': Error, '%eval%': eval, '%EvalError%': EvalError, '%Float32Array%': typeof Float32Array === 'undefined' ? undefined : Float32Array, '%Float64Array%': typeof Float64Array === 'undefined' ? undefined : Float64Array, '%FinalizationRegistry%': typeof FinalizationRegistry === 'undefined' ? undefined : FinalizationRegistry, '%Function%': $Function, '%GeneratorFunction%': needsEval, '%Int8Array%': typeof Int8Array === 'undefined' ? undefined : Int8Array, '%Int16Array%': typeof Int16Array === 'undefined' ? undefined : Int16Array, '%Int32Array%': typeof Int32Array === 'undefined' ? undefined : Int32Array, '%isFinite%': isFinite, '%isNaN%': isNaN, '%IteratorPrototype%': hasSymbols ? getProto(getProto([][Symbol.iterator]())) : undefined, '%JSON%': typeof JSON === 'object' ? JSON : undefined, '%Map%': typeof Map === 'undefined' ? undefined : Map, '%MapIteratorPrototype%': typeof Map === 'undefined' || !hasSymbols ? undefined : getProto(new Map()[Symbol.iterator]()), '%Math%': Math, '%Number%': Number, '%Object%': Object, '%parseFloat%': parseFloat, '%parseInt%': parseInt, '%Promise%': typeof Promise === 'undefined' ? undefined : Promise, '%Proxy%': typeof Proxy === 'undefined' ? undefined : Proxy, '%RangeError%': RangeError, '%ReferenceError%': ReferenceError, '%Reflect%': typeof Reflect === 'undefined' ? undefined : Reflect, '%RegExp%': RegExp, '%Set%': typeof Set === 'undefined' ? undefined : Set, '%SetIteratorPrototype%': typeof Set === 'undefined' || !hasSymbols ? undefined : getProto(new Set()[Symbol.iterator]()), '%SharedArrayBuffer%': typeof SharedArrayBuffer === 'undefined' ? undefined : SharedArrayBuffer, '%String%': String, '%StringIteratorPrototype%': hasSymbols ? getProto(''[Symbol.iterator]()) : undefined, '%Symbol%': hasSymbols ? Symbol : undefined, '%SyntaxError%': $SyntaxError, '%ThrowTypeError%': ThrowTypeError, '%TypedArray%': TypedArray, '%TypeError%': $TypeError, '%Uint8Array%': typeof Uint8Array === 'undefined' ? undefined : Uint8Array, '%Uint8ClampedArray%': typeof Uint8ClampedArray === 'undefined' ? undefined : Uint8ClampedArray, '%Uint16Array%': typeof Uint16Array === 'undefined' ? undefined : Uint16Array, '%Uint32Array%': typeof Uint32Array === 'undefined' ? undefined : Uint32Array, '%URIError%': URIError, '%WeakMap%': typeof WeakMap === 'undefined' ? undefined : WeakMap, '%WeakRef%': typeof WeakRef === 'undefined' ? undefined : WeakRef, '%WeakSet%': typeof WeakSet === 'undefined' ? undefined : WeakSet }; var doEval = function t(e) { var r; if (e === '%AsyncFunction%') { r = getEvalledConstructor('async function () {}'); } else if (e === '%GeneratorFunction%') { r = getEvalledConstructor('function* () {}'); } else if (e === '%AsyncGeneratorFunction%') { r = getEvalledConstructor('async function* () {}'); } else if (e === '%AsyncGenerator%') { var n = t('%AsyncGeneratorFunction%'); if (n) { r = n.prototype; } } else if (e === '%AsyncIteratorPrototype%') { var i = t('%AsyncGenerator%'); if (i) { r = getProto(i.prototype); } } INTRINSICS[e] = r; return r; }; var LEGACY_ALIASES = { '%ArrayBufferPrototype%': [ 'ArrayBuffer', 'prototype' ], '%ArrayPrototype%': [ 'Array', 'prototype' ], '%ArrayProto_entries%': [ 'Array', 'prototype', 'entries' ], '%ArrayProto_forEach%': [ 'Array', 'prototype', 'forEach' ], '%ArrayProto_keys%': [ 'Array', 'prototype', 'keys' ], '%ArrayProto_values%': [ 'Array', 'prototype', 'values' ], '%AsyncFunctionPrototype%': [ 'AsyncFunction', 'prototype' ], '%AsyncGenerator%': [ 'AsyncGeneratorFunction', 'prototype' ], '%AsyncGeneratorPrototype%': [ 'AsyncGeneratorFunction', 'prototype', 'prototype' ], '%BooleanPrototype%': [ 'Boolean', 'prototype' ], '%DataViewPrototype%': [ 'DataView', 'prototype' ], '%DatePrototype%': [ 'Date', 'prototype' ], '%ErrorPrototype%': [ 'Error', 'prototype' ], '%EvalErrorPrototype%': [ 'EvalError', 'prototype' ], '%Float32ArrayPrototype%': [ 'Float32Array', 'prototype' ], '%Float64ArrayPrototype%': [ 'Float64Array', 'prototype' ], '%FunctionPrototype%': [ 'Function', 'prototype' ], '%Generator%': [ 'GeneratorFunction', 'prototype' ], '%GeneratorPrototype%': [ 'GeneratorFunction', 'prototype', 'prototype' ], '%Int8ArrayPrototype%': [ 'Int8Array', 'prototype' ], '%Int16ArrayPrototype%': [ 'Int16Array', 'prototype' ], '%Int32ArrayPrototype%': [ 'Int32Array', 'prototype' ], '%JSONParse%': [ 'JSON', 'parse' ], '%JSONStringify%': [ 'JSON', 'stringify' ], '%MapPrototype%': [ 'Map', 'prototype' ], '%NumberPrototype%': [ 'Number', 'prototype' ], '%ObjectPrototype%': [ 'Object', 'prototype' ], '%ObjProto_toString%': [ 'Object', 'prototype', 'toString' ], '%ObjProto_valueOf%': [ 'Object', 'prototype', 'valueOf' ], '%PromisePrototype%': [ 'Promise', 'prototype' ], '%PromiseProto_then%': [ 'Promise', 'prototype', 'then' ], '%Promise_all%': [ 'Promise', 'all' ], '%Promise_reject%': [ 'Promise', 'reject' ], '%Promise_resolve%': [ 'Promise', 'resolve' ], '%RangeErrorPrototype%': [ 'RangeError', 'prototype' ], '%ReferenceErrorPrototype%': [ 'ReferenceError', 'prototype' ], '%RegExpPrototype%': [ 'RegExp', 'prototype' ], '%SetPrototype%': [ 'Set', 'prototype' ], '%SharedArrayBufferPrototype%': [ 'SharedArrayBuffer', 'prototype' ], '%StringPrototype%': [ 'String', 'prototype' ], '%SymbolPrototype%': [ 'Symbol', 'prototype' ], '%SyntaxErrorPrototype%': [ 'SyntaxError', 'prototype' ], '%TypedArrayPrototype%': [ 'TypedArray', 'prototype' ], '%TypeErrorPrototype%': [ 'TypeError', 'prototype' ], '%Uint8ArrayPrototype%': [ 'Uint8Array', 'prototype' ], '%Uint8ClampedArrayPrototype%': [ 'Uint8ClampedArray', 'prototype' ], '%Uint16ArrayPrototype%': [ 'Uint16Array', 'prototype' ], '%Uint32ArrayPrototype%': [ 'Uint32Array', 'prototype' ], '%URIErrorPrototype%': [ 'URIError', 'prototype' ], '%WeakMapPrototype%': [ 'WeakMap', 'prototype' ], '%WeakSetPrototype%': [ 'WeakSet', 'prototype' ] }; var bind = __webpack_require__(8612); var hasOwn = __webpack_require__(7642); var $concat = bind.call(Function.call, Array.prototype.concat); var $spliceApply = bind.call(Function.apply, Array.prototype.splice); var $replace = bind.call(Function.call, String.prototype.replace); var $strSlice = bind.call(Function.call, String.prototype.slice); var $exec = bind.call(Function.call, RegExp.prototype.exec); var rePropName = /[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g; var reEscapeChar = /\\(\\)?/g; var stringToPath = function t(e) { var r = $strSlice(e, 0, 1); var n = $strSlice(e, -1); if (r === '%' && n !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected closing `%`'); } else if (n === '%' && r !== '%') { throw new $SyntaxError('invalid intrinsic syntax, expected opening `%`'); } var i = []; $replace(e, rePropName, function(t, e, r, n) { i[i.length] = r ? $replace(n, reEscapeChar, '$1') : e || t; }); return i; }; var getBaseIntrinsic = function t(e, r) { var n = e; var i; if (hasOwn(LEGACY_ALIASES, n)) { i = LEGACY_ALIASES[n]; n = '%' + i[0] + '%'; } if (hasOwn(INTRINSICS, n)) { var o = INTRINSICS[n]; if (o === needsEval) { o = doEval(n); } if (typeof o === 'undefined' && !r) { throw new $TypeError('intrinsic ' + e + ' exists, but is not available. Please file an issue!'); } return { alias: i, name: n, value: o }; } throw new $SyntaxError('intrinsic ' + e + ' does not exist!'); }; module.exports = function t(e, r) { if (typeof e !== 'string' || e.length === 0) { throw new $TypeError('intrinsic name must be a non-empty string'); } if (arguments.length > 1 && typeof r !== 'boolean') { throw new $TypeError('"allowMissing" argument must be a boolean'); } if ($exec(/^%?[^%]*%?$/g, e) === null) { throw new $SyntaxError('`%` may not be present anywhere but at the beginning and end of the intrinsic name'); } var n = stringToPath(e); var i = n.length > 0 ? n[0] : ''; var o = getBaseIntrinsic('%' + i + '%', r); var s = o.name; var a = o.value; var f = false; var u = o.alias; if (u) { i = u[0]; $spliceApply(n, $concat([ 0, 1 ], u)); } for(var c = 1, l = true; c < n.length; c += 1){ var h = n[c]; var d = $strSlice(h, 0, 1); var p = $strSlice(h, -1); if (((d === '"' || d === "'" || d === '`') || (p === '"' || p === "'" || p === '`')) && d !== p) { throw new $SyntaxError('property names with quotes must have matching quotes'); } if (h === 'constructor' || !l) { f = true; } i += '.' + h; s = '%' + i + '%'; if (hasOwn(INTRINSICS, s)) { a = INTRINSICS[s]; } else if (a != null) { if (!(h in a)) { if (!r) { throw new $TypeError('base intrinsic for ' + e + ' exists, but the property is not available.'); } return void undefined; } if ($gOPD && (c + 1) >= n.length) { var g = $gOPD(a, h); l = !!g; if (l && 'get' in g && !('originalValue' in g.get)) { a = g.get; } else { a = a[h]; } } else { l = hasOwn(a, h); a = a[h]; } if (l && !f) { INTRINSICS[s] = a; } } } return a; }; }), 1405: (function(t, e, r) { "use strict"; var n = typeof Symbol !== 'undefined' && Symbol; var i = r(5419); t.exports = function t() { if (typeof n !== 'function') { return false; } if (typeof Symbol !== 'function') { return false; } if (typeof n('foo') !== 'symbol') { return false; } if (typeof Symbol('bar') !== 'symbol') { return false; } return i(); }; }), 5419: (function(t) { "use strict"; t.exports = function t() { if (typeof Symbol !== 'function' || typeof Object.getOwnPropertySymbols !== 'function') { return false; } if (typeof Symbol.iterator === 'symbol') { return true; } var e = {}; var r = Symbol('test'); var n = Object(r); if (typeof r === 'string') { return false; } if (Object.prototype.toString.call(r) !== '[object Symbol]') { return false; } if (Object.prototype.toString.call(n) !== '[object Symbol]') { return false; } var i = 42; e[r] = i; for(r in e){ return false; } if (typeof Object.keys === 'function' && Object.keys(e).length !== 0) { return false; } if (typeof Object.getOwnPropertyNames === 'function' && Object.getOwnPropertyNames(e).length !== 0) { return false; } var o = Object.getOwnPropertySymbols(e); if (o.length !== 1 || o[0] !== r) { return false; } if (!Object.prototype.propertyIsEnumerable.call(e, r)) { return false; } if (typeof Object.getOwnPropertyDescriptor === 'function') { var s = Object.getOwnPropertyDescriptor(e, r); if (s.value !== i || s.enumerable !== true) { return false; } } return true; }; }), 6410: (function(t, e, r) { "use strict"; var n = r(5419); t.exports = function t() { return n() && !!Symbol.toStringTag; }; }), 7642: (function(t, e, r) { "use strict"; var n = r(8612); t.exports = n.call(Function.call, Object.prototype.hasOwnProperty); }), 3715: (function(t, e, r) { var n = e; n.utils = r(6436); n.common = r(5772); n.sha = r(9041); n.ripemd = r(2949); n.hmac = r(2344); n.sha1 = n.sha.sha1; n.sha256 = n.sha.sha256; n.sha224 = n.sha.sha224; n.sha384 = n.sha.sha384; n.sha512 = n.sha.sha512; n.ripemd160 = n.ripemd.ripemd160; }), 5772: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(9746); function o() { this.pending = null; this.pendingTotal = 0; this.blockSize = this.constructor.blockSize; this.outSize = this.constructor.outSize; this.hmacStrength = this.constructor.hmacStrength; this.padLength = this.constructor.padLength / 8; this.endian = 'big'; this._delta8 = this.blockSize / 8; this._delta32 = this.blockSize / 32; } e.BlockHash = o; o.prototype.update = function t(e, r) { e = n.toArray(e, r); if (!this.pending) this.pending = e; else this.pending = this.pending.concat(e); this.pendingTotal += e.length; if (this.pending.length >= this._delta8) { e = this.pending; var i = e.length % this._delta8; this.pending = e.slice(e.length - i, e.length); if (this.pending.length === 0) this.pending = null; e = n.join32(e, 0, e.length - i, this.endian); for(var o = 0; o < e.length; o += this._delta32)this._update(e, o, o + this._delta32); } return this; }; o.prototype.digest = function t(e) { this.update(this._pad()); i(this.pending === null); return this._digest(e); }; o.prototype._pad = function t() { var e = this.pendingTotal; var r = this._delta8; var n = r - ((e + this.padLength) % r); var i = new Array(n + this.padLength); i[0] = 0x80; for(var o = 1; o < n; o++)i[o] = 0; e <<= 3; if (this.endian === 'big') { for(var s = 8; s < this.padLength; s++)i[o++] = 0; i[o++] = 0; i[o++] = 0; i[o++] = 0; i[o++] = 0; i[o++] = (e >>> 24) & 0xff; i[o++] = (e >>> 16) & 0xff; i[o++] = (e >>> 8) & 0xff; i[o++] = e & 0xff; } else { i[o++] = e & 0xff; i[o++] = (e >>> 8) & 0xff; i[o++] = (e >>> 16) & 0xff; i[o++] = (e >>> 24) & 0xff; i[o++] = 0; i[o++] = 0; i[o++] = 0; i[o++] = 0; for(s = 8; s < this.padLength; s++)i[o++] = 0; } return i; }; }), 2344: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(9746); function o(t, e, r) { if (!(this instanceof o)) return new o(t, e, r); this.Hash = t; this.blockSize = t.blockSize / 8; this.outSize = t.outSize / 8; this.inner = null; this.outer = null; this._init(n.toArray(e, r)); } t.exports = o; o.prototype._init = function t(e) { if (e.length > this.blockSize) e = new this.Hash().update(e).digest(); i(e.length <= this.blockSize); for(var r = e.length; r < this.blockSize; r++)e.push(0); for(r = 0; r < e.length; r++)e[r] ^= 0x36; this.inner = new this.Hash().update(e); for(r = 0; r < e.length; r++)e[r] ^= 0x6a; this.outer = new this.Hash().update(e); }; o.prototype.update = function t(e, r) { this.inner.update(e, r); return this; }; o.prototype.digest = function t(e) { this.outer.update(this.inner.digest()); return this.outer.digest(e); }; }), 2949: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(5772); var o = n.rotl32; var s = n.sum32; var a = n.sum32_3; var f = n.sum32_4; var u = i.BlockHash; function c() { if (!(this instanceof c)) return new c(); u.call(this); this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; this.endian = 'little'; } n.inherits(c, u); e.ripemd160 = c; c.blockSize = 512; c.outSize = 160; c.hmacStrength = 192; c.padLength = 64; c.prototype._update = function t(e, r) { var n = this.h[0]; var i = this.h[1]; var u = this.h[2]; var c = this.h[3]; var y = this.h[4]; var m = n; var w = i; var _ = u; var S = c; var E = y; for(var x = 0; x < 80; x++){ var M = s(o(f(n, l(x, i, u, c), e[p[x] + r], h(x)), b[x]), y); n = y; y = c; c = o(u, 10); u = i; i = M; M = s(o(f(m, l(79 - x, w, _, S), e[g[x] + r], d(x)), v[x]), E); m = E; E = S; S = o(_, 10); _ = w; w = M; } M = a(this.h[1], u, S); this.h[1] = a(this.h[2], c, E); this.h[2] = a(this.h[3], y, m); this.h[3] = a(this.h[4], n, w); this.h[4] = a(this.h[0], i, _); this.h[0] = M; }; c.prototype._digest = function t(e) { if (e === 'hex') return n.toHex32(this.h, 'little'); else return n.split32(this.h, 'little'); }; function l(t, e, r, n) { if (t <= 15) return e ^ r ^ n; else if (t <= 31) return (e & r) | ((~e) & n); else if (t <= 47) return (e | (~r)) ^ n; else if (t <= 63) return (e & n) | (r & (~n)); else return e ^ (r | (~n)); } function h(t) { if (t <= 15) return 0x00000000; else if (t <= 31) return 0x5a827999; else if (t <= 47) return 0x6ed9eba1; else if (t <= 63) return 0x8f1bbcdc; else return 0xa953fd4e; } function d(t) { if (t <= 15) return 0x50a28be6; else if (t <= 31) return 0x5c4dd124; else if (t <= 47) return 0x6d703ef3; else if (t <= 63) return 0x7a6d76e9; else return 0x00000000; } var p = [ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13 ]; var g = [ 5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11 ]; var b = [ 11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6 ]; var v = [ 8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11 ]; }), 9041: (function(t, e, r) { "use strict"; e.sha1 = r(4761); e.sha224 = r(799); e.sha256 = r(9344); e.sha384 = r(772); e.sha512 = r(5900); }), 4761: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(5772); var o = r(7038); var s = n.rotl32; var a = n.sum32; var f = n.sum32_5; var u = o.ft_1; var c = i.BlockHash; var l = [ 0x5A827999, 0x6ED9EBA1, 0x8F1BBCDC, 0xCA62C1D6 ]; function h() { if (!(this instanceof h)) return new h(); c.call(this); this.h = [ 0x67452301, 0xefcdab89, 0x98badcfe, 0x10325476, 0xc3d2e1f0 ]; this.W = new Array(80); } n.inherits(h, c); t.exports = h; h.blockSize = 512; h.outSize = 160; h.hmacStrength = 80; h.padLength = 64; h.prototype._update = function t(e, r) { var n = this.W; for(var i = 0; i < 16; i++)n[i] = e[r + i]; for(; i < n.length; i++)n[i] = s(n[i - 3] ^ n[i - 8] ^ n[i - 14] ^ n[i - 16], 1); var o = this.h[0]; var c = this.h[1]; var h = this.h[2]; var d = this.h[3]; var p = this.h[4]; for(i = 0; i < n.length; i++){ var g = ~~(i / 20); var b = f(s(o, 5), u(g, c, h, d), p, n[i], l[g]); p = d; d = h; h = s(c, 30); c = o; o = b; } this.h[0] = a(this.h[0], o); this.h[1] = a(this.h[1], c); this.h[2] = a(this.h[2], h); this.h[3] = a(this.h[3], d); this.h[4] = a(this.h[4], p); }; h.prototype._digest = function t(e) { if (e === 'hex') return n.toHex32(this.h, 'big'); else return n.split32(this.h, 'big'); }; }), 799: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(9344); function o() { if (!(this instanceof o)) return new o(); i.call(this); this.h = [ 0xc1059ed8, 0x367cd507, 0x3070dd17, 0xf70e5939, 0xffc00b31, 0x68581511, 0x64f98fa7, 0xbefa4fa4 ]; } n.inherits(o, i); t.exports = o; o.blockSize = 512; o.outSize = 224; o.hmacStrength = 192; o.padLength = 64; o.prototype._digest = function t(e) { if (e === 'hex') return n.toHex32(this.h.slice(0, 7), 'big'); else return n.split32(this.h.slice(0, 7), 'big'); }; }), 9344: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(5772); var o = r(7038); var s = r(9746); var a = n.sum32; var f = n.sum32_4; var u = n.sum32_5; var c = o.ch32; var l = o.maj32; var h = o.s0_256; var d = o.s1_256; var p = o.g0_256; var g = o.g1_256; var b = i.BlockHash; var v = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 ]; function y() { if (!(this instanceof y)) return new y(); b.call(this); this.h = [ 0x6a09e667, 0xbb67ae85, 0x3c6ef372, 0xa54ff53a, 0x510e527f, 0x9b05688c, 0x1f83d9ab, 0x5be0cd19 ]; this.k = v; this.W = new Array(64); } n.inherits(y, b); t.exports = y; y.blockSize = 512; y.outSize = 256; y.hmacStrength = 192; y.padLength = 64; y.prototype._update = function t(e, r) { var n = this.W; for(var i = 0; i < 16; i++)n[i] = e[r + i]; for(; i < n.length; i++)n[i] = f(g(n[i - 2]), n[i - 7], p(n[i - 15]), n[i - 16]); var o = this.h[0]; var b = this.h[1]; var v = this.h[2]; var y = this.h[3]; var m = this.h[4]; var w = this.h[5]; var _ = this.h[6]; var S = this.h[7]; s(this.k.length === n.length); for(i = 0; i < n.length; i++){ var E = u(S, d(m), c(m, w, _), this.k[i], n[i]); var x = a(h(o), l(o, b, v)); S = _; _ = w; w = m; m = a(y, E); y = v; v = b; b = o; o = a(E, x); } this.h[0] = a(this.h[0], o); this.h[1] = a(this.h[1], b); this.h[2] = a(this.h[2], v); this.h[3] = a(this.h[3], y); this.h[4] = a(this.h[4], m); this.h[5] = a(this.h[5], w); this.h[6] = a(this.h[6], _); this.h[7] = a(this.h[7], S); }; y.prototype._digest = function t(e) { if (e === 'hex') return n.toHex32(this.h, 'big'); else return n.split32(this.h, 'big'); }; }), 772: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(5900); function o() { if (!(this instanceof o)) return new o(); i.call(this); this.h = [ 0xcbbb9d5d, 0xc1059ed8, 0x629a292a, 0x367cd507, 0x9159015a, 0x3070dd17, 0x152fecd8, 0xf70e5939, 0x67332667, 0xffc00b31, 0x8eb44a87, 0x68581511, 0xdb0c2e0d, 0x64f98fa7, 0x47b5481d, 0xbefa4fa4 ]; } n.inherits(o, i); t.exports = o; o.blockSize = 1024; o.outSize = 384; o.hmacStrength = 192; o.padLength = 128; o.prototype._digest = function t(e) { if (e === 'hex') return n.toHex32(this.h.slice(0, 12), 'big'); else return n.split32(this.h.slice(0, 12), 'big'); }; }), 5900: (function(t, e, r) { "use strict"; var n = r(6436); var i = r(5772); var o = r(9746); var s = n.rotr64_hi; var a = n.rotr64_lo; var f = n.shr64_hi; var u = n.shr64_lo; var c = n.sum64; var l = n.sum64_hi; var h = n.sum64_lo; var d = n.sum64_4_hi; var p = n.sum64_4_lo; var g = n.sum64_5_hi; var b = n.sum64_5_lo; var v = i.BlockHash; var y = [ 0x428a2f98, 0xd728ae22, 0x71374491, 0x23ef65cd, 0xb5c0fbcf, 0xec4d3b2f, 0xe9b5dba5, 0x8189dbbc, 0x3956c25b, 0xf348b538, 0x59f111f1, 0xb605d019, 0x923f82a4, 0xaf194f9b, 0xab1c5ed5, 0xda6d8118, 0xd807aa98, 0xa3030242, 0x12835b01, 0x45706fbe, 0x243185be, 0x4ee4b28c, 0x550c7dc3, 0xd5ffb4e2, 0x72be5d74, 0xf27b896f, 0x80deb1fe, 0x3b1696b1, 0x9bdc06a7, 0x25c71235, 0xc19bf174, 0xcf692694, 0xe49b69c1, 0x9ef14ad2, 0xefbe4786, 0x384f25e3, 0x0fc19dc6, 0x8b8cd5b5, 0x240ca1cc, 0x77ac9c65, 0x2de92c6f, 0x592b0275, 0x4a7484aa, 0x6ea6e483, 0x5cb0a9dc, 0xbd41fbd4, 0x76f988da, 0x831153b5, 0x983e5152, 0xee66dfab, 0xa831c66d, 0x2db43210, 0xb00327c8, 0x98fb213f, 0xbf597fc7, 0xbeef0ee4, 0xc6e00bf3, 0x3da88fc2, 0xd5a79147, 0x930aa725, 0x06ca6351, 0xe003826f, 0x14292967, 0x0a0e6e70, 0x27b70a85, 0x46d22ffc, 0x2e1b2138, 0x5c26c926, 0x4d2c6dfc, 0x5ac42aed, 0x53380d13, 0x9d95b3df, 0x650a7354, 0x8baf63de, 0x766a0abb, 0x3c77b2a8, 0x81c2c92e, 0x47edaee6, 0x92722c85, 0x1482353b, 0xa2bfe8a1, 0x4cf10364, 0xa81a664b, 0xbc423001, 0xc24b8b70, 0xd0f89791, 0xc76c51a3, 0x0654be30, 0xd192e819, 0xd6ef5218, 0xd6990624, 0x5565a910, 0xf40e3585, 0x5771202a, 0x106aa070, 0x32bbd1b8, 0x19a4c116, 0xb8d2d0c8, 0x1e376c08, 0x5141ab53, 0x2748774c, 0xdf8eeb99, 0x34b0bcb5, 0xe19b48a8, 0x391c0cb3, 0xc5c95a63, 0x4ed8aa4a, 0xe3418acb, 0x5b9cca4f, 0x7763e373, 0x682e6ff3, 0xd6b2b8a3, 0x748f82ee, 0x5defb2fc, 0x78a5636f, 0x43172f60, 0x84c87814, 0xa1f0ab72, 0x8cc70208, 0x1a6439ec, 0x90befffa, 0x23631e28, 0xa4506ceb, 0xde82bde9, 0xbef9a3f7, 0xb2c67915, 0xc67178f2, 0xe372532b, 0xca273ece, 0xea26619c, 0xd186b8c7, 0x21c0c207, 0xeada7dd6, 0xcde0eb1e, 0xf57d4f7f, 0xee6ed178, 0x06f067aa, 0x72176fba, 0x0a637dc5, 0xa2c898a6, 0x113f9804, 0xbef90dae, 0x1b710b35, 0x131c471b, 0x28db77f5, 0x23047d84, 0x32caab7b, 0x40c72493, 0x3c9ebe0a, 0x15c9bebc, 0x431d67c4, 0x9c100d4c, 0x4cc5d4be, 0xcb3e42b6, 0x597f299c, 0xfc657e2a, 0x5fcb6fab, 0x3ad6faec, 0x6c44198c, 0x4a475817 ]; function m() { if (!(this instanceof m)) return new m(); v.call(this); this.h = [ 0x6a09e667, 0xf3bcc908, 0xbb67ae85, 0x84caa73b, 0x3c6ef372, 0xfe94f82b, 0xa54ff53a, 0x5f1d36f1, 0x510e527f, 0xade682d1, 0x9b05688c, 0x2b3e6c1f, 0x1f83d9ab, 0xfb41bd6b, 0x5be0cd19, 0x137e2179 ]; this.k = y; this.W = new Array(160); } n.inherits(m, v); t.exports = m; m.blockSize = 1024; m.outSize = 512; m.hmacStrength = 192; m.padLength = 128; m.prototype._prepareBlock = function t(e, r) { var n = this.W; for(var i = 0; i < 32; i++)n[i] = e[r + i]; for(; i < n.length; i += 2){ var o = I(n[i - 4], n[i - 3]); var s = R(n[i - 4], n[i - 3]); var a = n[i - 14]; var f = n[i - 13]; var u = O(n[i - 30], n[i - 29]); var c = k(n[i - 30], n[i - 29]); var l = n[i - 32]; var h = n[i - 31]; n[i] = d(o, s, a, f, u, c, l, h); n[i + 1] = p(o, s, a, f, u, c, l, h); } }; m.prototype._update = function t(e, r) { this._prepareBlock(e, r); var n = this.W; var i = this.h[0]; var s = this.h[1]; var a = this.h[2]; var f = this.h[3]; var u = this.h[4]; var d = this.h[5]; var p = this.h[6]; var v = this.h[7]; var y = this.h[8]; var m = this.h[9]; var O = this.h[10]; var k = this.h[11]; var I = this.h[12]; var R = this.h[13]; var N = this.h[14]; var j = this.h[15]; o(this.k.length === n.length); for(var P = 0; P < n.length; P += 2){ var C = N; var B = j; var L = T(y, m); var U = A(y, m); var D = w(y, m, O, k, I, R); var $ = _(y, m, O, k, I, R); var F = this.k[P]; var W = this.k[P + 1]; var q = n[P]; var z = n[P + 1]; var G = g(C, B, L, U, D, $, F, W, q, z); var K = b(C, B, L, U, D, $, F, W, q, z); C = x(i, s); B = M(i, s); L = S(i, s, a, f, u, d); U = E(i, s, a, f, u, d); var V = l(C, B, L, U); var H = h(C, B, L, U); N = I; j = R; I = O; R = k; O = y; k = m; y = l(p, v, G, K); m = h(v, v, G, K); p = u; v = d; u = a; d = f; a = i; f = s; i = l(G, K, V, H); s = h(G, K, V, H); } c(this.h, 0, i, s); c(this.h, 2, a, f); c(this.h, 4, u, d); c(this.h, 6, p, v); c(this.h, 8, y, m); c(this.h, 10, O, k); c(this.h, 12, I, R); c(this.h, 14, N, j); }; m.prototype._digest = function t(e) { if (e === 'hex') return n.toHex32(this.h, 'big'); else return n.split32(this.h, 'big'); }; function w(t, e, r, n, i) { var o = (t & r) ^ ((~t) & i); if (o < 0) o += 0x100000000; return o; } function _(t, e, r, n, i, o) { var s = (e & n) ^ ((~e) & o); if (s < 0) s += 0x100000000; return s; } function S(t, e, r, n, i) { var o = (t & r) ^ (t & i) ^ (r & i); if (o < 0) o += 0x100000000; return o; } function E(t, e, r, n, i, o) { var s = (e & n) ^ (e & o) ^ (n & o); if (s < 0) s += 0x100000000; return s; } function x(t, e) { var r = s(t, e, 28); var n = s(e, t, 2); var i = s(e, t, 7); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } function M(t, e) { var r = a(t, e, 28); var n = a(e, t, 2); var i = a(e, t, 7); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } function T(t, e) { var r = s(t, e, 14); var n = s(t, e, 18); var i = s(e, t, 9); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } function A(t, e) { var r = a(t, e, 14); var n = a(t, e, 18); var i = a(e, t, 9); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } function O(t, e) { var r = s(t, e, 1); var n = s(t, e, 8); var i = f(t, e, 7); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } function k(t, e) { var r = a(t, e, 1); var n = a(t, e, 8); var i = u(t, e, 7); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } function I(t, e) { var r = s(t, e, 19); var n = s(e, t, 29); var i = f(t, e, 6); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } function R(t, e) { var r = a(t, e, 19); var n = a(e, t, 29); var i = u(t, e, 6); var o = r ^ n ^ i; if (o < 0) o += 0x100000000; return o; } }), 7038: (function(t, e, r) { "use strict"; var n = r(6436); var i = n.rotr32; function o(t, e, r, n) { if (t === 0) return s(e, r, n); if (t === 1 || t === 3) return f(e, r, n); if (t === 2) return a(e, r, n); } e.ft_1 = o; function s(t, e, r) { return (t & e) ^ ((~t) & r); } e.ch32 = s; function a(t, e, r) { return (t & e) ^ (t & r) ^ (e & r); } e.maj32 = a; function f(t, e, r) { return t ^ e ^ r; } e.p32 = f; function u(t) { return i(t, 2) ^ i(t, 13) ^ i(t, 22); } e.s0_256 = u; function c(t) { return i(t, 6) ^ i(t, 11) ^ i(t, 25); } e.s1_256 = c; function l(t) { return i(t, 7) ^ i(t, 18) ^ (t >>> 3); } e.g0_256 = l; function h(t) { return i(t, 17) ^ i(t, 19) ^ (t >>> 10); } e.g1_256 = h; }), 6436: (function(t, e, r) { "use strict"; var n = r(9746); var i = r(5717); e.inherits = i; function o(t, e) { if ((t.charCodeAt(e) & 0xFC00) !== 0xD800) { return false; } if (e < 0 || e + 1 >= t.length) { return false; } return (t.charCodeAt(e + 1) & 0xFC00) === 0xDC00; } function s(t, e) { if (Array.isArray(t)) return t.slice(); if (!t) return []; var r = []; if (typeof t === 'string') { if (!e) { var n = 0; for(var i = 0; i < t.length; i++){ var s = t.charCodeAt(i); if (s < 128) { r[n++] = s; } else if (s < 2048) { r[n++] = (s >> 6) | 192; r[n++] = (s & 63) | 128; } else if (o(t, i)) { s = 0x10000 + ((s & 0x03FF) << 10) + (t.charCodeAt(++i) & 0x03FF); r[n++] = (s >> 18) | 240; r[n++] = ((s >> 12) & 63) | 128; r[n++] = ((s >> 6) & 63) | 128; r[n++] = (s & 63) | 128; } else { r[n++] = (s >> 12) | 224; r[n++] = ((s >> 6) & 63) | 128; r[n++] = (s & 63) | 128; } } } else if (e === 'hex') { t = t.replace(/[^a-z0-9]+/ig, ''); if (t.length % 2 !== 0) t = '0' + t; for(i = 0; i < t.length; i += 2)r.push(parseInt(t[i] + t[i + 1], 16)); } } else { for(i = 0; i < t.length; i++)r[i] = t[i] | 0; } return r; } e.toArray = s; function a(t) { var e = ''; for(var r = 0; r < t.length; r++)e += c(t[r].toString(16)); return e; } e.toHex = a; function f(t) { var e = (t >>> 24) | ((t >>> 8) & 0xff00) | ((t << 8) & 0xff0000) | ((t & 0xff) << 24); return e >>> 0; } e.htonl = f; function u(t, e) { var r = ''; for(var n = 0; n < t.length; n++){ var i = t[n]; if (e === 'little') i = f(i); r += l(i.toString(16)); } return r; } e.toHex32 = u; function c(t) { if (t.length === 1) return '0' + t; else return t; } e.zero2 = c; function l(t) { if (t.length === 7) return '0' + t; else if (t.length === 6) return '00' + t; else if (t.length === 5) return '000' + t; else if (t.length === 4) return '0000' + t; else if (t.length === 3) return '00000' + t; else if (t.length === 2) return '000000' + t; else if (t.length === 1) return '0000000' + t; else return t; } e.zero8 = l; function h(t, e, r, i) { var o = r - e; n(o % 4 === 0); var s = new Array(o / 4); for(var a = 0, f = e; a < s.length; a++, f += 4){ var u; if (i === 'big') u = (t[f] << 24) | (t[f + 1] << 16) | (t[f + 2] << 8) | t[f + 3]; else u = (t[f + 3] << 24) | (t[f + 2] << 16) | (t[f + 1] << 8) | t[f]; s[a] = u >>> 0; } return s; } e.join32 = h; function d(t, e) { var r = new Array(t.length * 4); for(var n = 0, i = 0; n < t.length; n++, i += 4){ var o = t[n]; if (e === 'big') { r[i] = o >>> 24; r[i + 1] = (o >>> 16) & 0xff; r[i + 2] = (o >>> 8) & 0xff; r[i + 3] = o & 0xff; } else { r[i + 3] = o >>> 24; r[i + 2] = (o >>> 16) & 0xff; r[i + 1] = (o >>> 8) & 0xff; r[i] = o & 0xff; } } return r; } e.split32 = d; function p(t, e) { return (t >>> e) | (t << (32 - e)); } e.rotr32 = p; function g(t, e) { return (t << e) | (t >>> (32 - e)); } e.rotl32 = g; function b(t, e) { return (t + e) >>> 0; } e.sum32 = b; function v(t, e, r) { return (t + e + r) >>> 0; } e.sum32_3 = v; function y(t, e, r, n) { return (t + e + r + n) >>> 0; } e.sum32_4 = y; function m(t, e, r, n, i) { return (t + e + r + n + i) >>> 0; } e.sum32_5 = m; function w(t, e, r, n) { var i = t[e]; var o = t[e + 1]; var s = (n + o) >>> 0; var a = (s < n ? 1 : 0) + r + i; t[e] = a >>> 0; t[e + 1] = s; } e.sum64 = w; function _(t, e, r, n) { var i = (e + n) >>> 0; var o = (i < e ? 1 : 0) + t + r; return o >>> 0; } e.sum64_hi = _; function S(t, e, r, n) { var i = e + n; return i >>> 0; } e.sum64_lo = S; function E(t, e, r, n, i, o, s, a) { var f = 0; var u = e; u = (u + n) >>> 0; f += u < e ? 1 : 0; u = (u + o) >>> 0; f += u < o ? 1 : 0; u = (u + a) >>> 0; f += u < a ? 1 : 0; var c = t + r + i + s + f; return c >>> 0; } e.sum64_4_hi = E; function x(t, e, r, n, i, o, s, a) { var f = e + n + o + a; return f >>> 0; } e.sum64_4_lo = x; function M(t, e, r, n, i, o, s, a, f, u) { var c = 0; var l = e; l = (l + n) >>> 0; c += l < e ? 1 : 0; l = (l + o) >>> 0; c += l < o ? 1 : 0; l = (l + a) >>> 0; c += l < a ? 1 : 0; l = (l + u) >>> 0; c += l < u ? 1 : 0; var h = t + r + i + s + f + c; return h >>> 0; } e.sum64_5_hi = M; function T(t, e, r, n, i, o, s, a, f, u) { var c = e + n + o + a + u; return c >>> 0; } e.sum64_5_lo = T; function A(t, e, r) { var n = (e << (32 - r)) | (t >>> r); return n >>> 0; } e.rotr64_hi = A; function O(t, e, r) { var n = (t << (32 - r)) | (e >>> r); return n >>> 0; } e.rotr64_lo = O; function k(t, e, r) { return t >>> r; } e.shr64_hi = k; function I(t, e, r) { var n = (t << (32 - r)) | (e >>> r); return n >>> 0; } e.shr64_lo = I; }), 2156: (function(t, e, r) { "use strict"; var n = r(3715); var i = r(4504); var o = r(9746); function s(t) { if (!(this instanceof s)) return new s(t); this.hash = t.hash; this.predResist = !!t.predResist; this.outLen = this.hash.outSize; this.minEntropy = t.minEntropy || this.hash.hmacStrength; this._reseed = null; this.reseedInterval = null; this.K = null; this.V = null; var e = i.toArray(t.entropy, t.entropyEnc || 'hex'); var r = i.toArray(t.nonce, t.nonceEnc || 'hex'); var n = i.toArray(t.pers, t.persEnc || 'hex'); o(e.length >= (this.minEntropy / 8), 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); this._init(e, r, n); } t.exports = s; s.prototype._init = function t(e, r, n) { var i = e.concat(r).concat(n); this.K = new Array(this.outLen / 8); this.V = new Array(this.outLen / 8); for(var o = 0; o < this.V.length; o++){ this.K[o] = 0x00; this.V[o] = 0x01; } this._update(i); this._reseed = 1; this.reseedInterval = 0x1000000000000; }; s.prototype._hmac = function t() { return new n.hmac(this.hash, this.K); }; s.prototype._update = function t(e) { var r = this._hmac().update(this.V).update([ 0x00 ]); if (e) r = r.update(e); this.K = r.digest(); this.V = this._hmac().update(this.V).digest(); if (!e) return; this.K = this._hmac().update(this.V).update([ 0x01 ]).update(e).digest(); this.V = this._hmac().update(this.V).digest(); }; s.prototype.reseed = function t(e, r, n, s) { if (typeof r !== 'string') { s = n; n = r; r = null; } e = i.toArray(e, r); n = i.toArray(n, s); o(e.length >= (this.minEntropy / 8), 'Not enough entropy. Minimum is: ' + this.minEntropy + ' bits'); this._update(e.concat(n || [])); this._reseed = 1; }; s.prototype.generate = function t(e, r, n, o) { if (this._reseed > this.reseedInterval) throw new Error('Reseed is required'); if (typeof r !== 'string') { o = n; n = r; r = null; } if (n) { n = i.toArray(n, o || 'hex'); this._update(n); } var s = []; while(s.length < e){ this.V = this._hmac().update(this.V).digest(); s = s.concat(this.V); } var a = s.slice(0, e); this._update(n); this._reseed++; return i.encode(a, r); }; }), 645: (function(t, e) { e.read = function(t, e, r, n, i) { var o, s; var a = (i * 8) - n - 1; var f = (1 << a) - 1; var u = f >> 1; var c = -7; var l = r ? (i - 1) : 0; var h = r ? -1 : 1; var d = t[e + l]; l += h; o = d & ((1 << (-c)) - 1); d >>= (-c); c += a; for(; c > 0; o = (o * 256) + t[e + l], l += h, c -= 8){} s = o & ((1 << (-c)) - 1); o >>= (-c); c += n; for(; c > 0; s = (s * 256) + t[e + l], l += h, c -= 8){} if (o === 0) { o = 1 - u; } else if (o === f) { return s ? NaN : ((d ? -1 : 1) * Infinity); } else { s = s + Math.pow(2, n); o = o - u; } return (d ? -1 : 1) * s * Math.pow(2, o - n); }; e.write = function(t, e, r, n, i, o) { var s, a, f; var u = (o * 8) - i - 1; var c = (1 << u) - 1; var l = c >> 1; var h = (i === 23 ? Math.pow(2, -24) - Math.pow(2, -77) : 0); var d = n ? 0 : (o - 1); var p = n ? 1 : -1; var g = e < 0 || (e === 0 && 1 / e < 0) ? 1 : 0; e = Math.abs(e); if (isNaN(e) || e === Infinity) { a = isNaN(e) ? 1 : 0; s = c; } else { s = Math.floor(Math.log(e) / Math.LN2); if (e * (f = Math.pow(2, -s)) < 1) { s--; f *= 2; } if (s + l >= 1) { e += h / f; } else { e += h * Math.pow(2, 1 - l); } if (e * f >= 2) { s++; f /= 2; } if (s + l >= c) { a = 0; s = c; } else if (s + l >= 1) { a = ((e * f) - 1) * Math.pow(2, i); s = s + l; } else { a = e * Math.pow(2, l - 1) * Math.pow(2, i); s = 0; } } for(; i >= 8; t[r + d] = a & 0xff, d += p, a /= 256, i -= 8){} s = (s << i) | a; u += i; for(; u > 0; t[r + d] = s & 0xff, d += p, s /= 256, u -= 8){} t[r + d - p] |= g * 128; }; }), 5717: (function(t) { if (typeof Object.create === 'function') { t.exports = function t(e, r) { if (r) { e.super_ = r; e.prototype = Object.create(r.prototype, { constructor: { value: e, enumerable: false, writable: true, configurable: true } }); } }; } else { t.exports = function t(e, r) { if (r) { e.super_ = r; var n = function() {}; n.prototype = r.prototype; e.prototype = new n(); e.prototype.constructor = e; } }; } }), 2584: (function(t, e, r) { "use strict"; var n = r(6410)(); var i = r(1924); var o = i('Object.prototype.toString'); var s = function t(e) { if (n && e && typeof e === 'object' && Symbol.toStringTag in e) { return false; } return o(e) === '[object Arguments]'; }; var a = function t(e) { if (s(e)) { return true; } return e !== null && typeof e === 'object' && typeof e.length === 'number' && e.length >= 0 && o(e) !== '[object Array]' && o(e.callee) === '[object Function]'; }; var f = (function() { return s(arguments); }()); s.isLegacyArguments = a; t.exports = f ? s : a; }), 5320: (function(t) { "use strict"; var e = Function.prototype.toString; var r = typeof Reflect === 'object' && Reflect !== null && Reflect.apply; var n; var i; if (typeof r === 'function' && typeof Object.defineProperty === 'function') { try { n = Object.defineProperty({}, 'length', { get: function() { throw i; } }); i = {}; r(function() { throw 42; }, null, n); } catch (o) { if (o !== i) { r = null; } } } else { r = null; } var s = /^\s*class\b/; var a = function t(r) { try { var n = e.call(r); return s.test(n); } catch (i) { return false; } }; var f = function t(r) { try { if (a(r)) { return false; } e.call(r); return true; } catch (n) { return false; } }; var u = Object.prototype.toString; var c = '[object Function]'; var l = '[object GeneratorFunction]'; var h = typeof Symbol === 'function' && !!Symbol.toStringTag; var d = typeof document === 'object' && typeof document.all === 'undefined' && document.all !== undefined ? document.all : {}; t.exports = r ? function t(e) { if (e === d) { return true; } if (!e) { return false; } if (typeof e !== 'function' && typeof e !== 'object') { return false; } if (typeof e === 'function' && !e.prototype) { return true; } try { r(e, null, n); } catch (o) { if (o !== i) { return false; } } return !a(e); } : function t(e) { if (e === d) { return true; } if (!e) { return false; } if (typeof e !== 'function' && typeof e !== 'object') { return false; } if (typeof e === 'function' && !e.prototype) { return true; } if (h) { return f(e); } if (a(e)) { return false; } var r = u.call(e); return r === c || r === l; }; }), 8662: (function(t, e, r) { "use strict"; var n = Object.prototype.toString; var i = Function.prototype.toString; var o = /^\s*(?:function)?\*/; var s = r(6410)(); var a = Object.getPrototypeOf; var f = function() { if (!s) { return false; } try { return Function('return function*() {}')(); } catch (t) {} }; var u; t.exports = function t(e) { if (typeof e !== 'function') { return false; } if (o.test(i.call(e))) { return true; } if (!s) { var r = n.call(e); return r === '[object GeneratorFunction]'; } if (!a) { return false; } if (typeof u === 'undefined') { var c = f(); u = c ? a(c) : false; } return a(e) === u; }; }), 5692: (function(t, e, r) { "use strict"; var n = r(4029); var i = r(3083); var o = r(1924); var s = o('Object.prototype.toString'); var a = r(6410)(); var f = typeof globalThis === 'undefined' ? r.g : globalThis; var u = i(); var c = o('Array.prototype.indexOf', true) || function t(e, r) { for(var n = 0; n < e.length; n += 1){ if (e[n] === r) { return n; } } return -1; }; var l = o('String.prototype.slice'); var h = {}; var d = r(882); var p = Object.getPrototypeOf; if (a && d && p) { n(u, function(t) { var e = new f[t](); if (Symbol.toStringTag in e) { var r = p(e); var n = d(r, Symbol.toStringTag); if (!n) { var i = p(r); n = d(i, Symbol.toStringTag); } h[t] = n.get; } }); } var g = function t(e) { var r = false; n(h, function(t, n) { if (!r) { try { r = t.call(e) === n; } catch (i) {} } }); return r; }; t.exports = function t(e) { if (!e || typeof e !== 'object') { return false; } if (!a || !(Symbol.toStringTag in e)) { var r = l(s(e), 8, -1); return c(u, r) > -1; } if (!d) { return false; } return g(e); }; }), 2023: (function(module, exports, __webpack_require__) { var process = __webpack_require__(3454); var __WEBPACK_AMD_DEFINE_RESULT__; (function() { 'use strict'; var ERROR = 'input is invalid type'; var WINDOW = typeof window === 'object'; var root = WINDOW ? window : {}; if (root.JS_SHA256_NO_WINDOW) { WINDOW = false; } var WEB_WORKER = !WINDOW && typeof self === 'object'; var NODE_JS = !root.JS_SHA256_NO_NODE_JS && typeof process === 'object' && process.versions && process.versions.node; if (NODE_JS) { root = __webpack_require__.g; } else if (WEB_WORKER) { root = self; } var COMMON_JS = !root.JS_SHA256_NO_COMMON_JS && "object" === 'object' && module.exports; var AMD = true && __webpack_require__.amdO; var ARRAY_BUFFER = !root.JS_SHA256_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; var HEX_CHARS = '0123456789abcdef'.split(''); var EXTRA = [ -2147483648, 8388608, 32768, 128 ]; var SHIFT = [ 24, 16, 8, 0 ]; var K = [ 0x428a2f98, 0x71374491, 0xb5c0fbcf, 0xe9b5dba5, 0x3956c25b, 0x59f111f1, 0x923f82a4, 0xab1c5ed5, 0xd807aa98, 0x12835b01, 0x243185be, 0x550c7dc3, 0x72be5d74, 0x80deb1fe, 0x9bdc06a7, 0xc19bf174, 0xe49b69c1, 0xefbe4786, 0x0fc19dc6, 0x240ca1cc, 0x2de92c6f, 0x4a7484aa, 0x5cb0a9dc, 0x76f988da, 0x983e5152, 0xa831c66d, 0xb00327c8, 0xbf597fc7, 0xc6e00bf3, 0xd5a79147, 0x06ca6351, 0x14292967, 0x27b70a85, 0x2e1b2138, 0x4d2c6dfc, 0x53380d13, 0x650a7354, 0x766a0abb, 0x81c2c92e, 0x92722c85, 0xa2bfe8a1, 0xa81a664b, 0xc24b8b70, 0xc76c51a3, 0xd192e819, 0xd6990624, 0xf40e3585, 0x106aa070, 0x19a4c116, 0x1e376c08, 0x2748774c, 0x34b0bcb5, 0x391c0cb3, 0x4ed8aa4a, 0x5b9cca4f, 0x682e6ff3, 0x748f82ee, 0x78a5636f, 0x84c87814, 0x8cc70208, 0x90befffa, 0xa4506ceb, 0xbef9a3f7, 0xc67178f2 ]; var OUTPUT_TYPES = [ 'hex', 'array', 'digest', 'arrayBuffer' ]; var blocks = []; if (root.JS_SHA256_NO_NODE_JS || !Array.isArray) { Array.isArray = function(t) { return Object.prototype.toString.call(t) === '[object Array]'; }; } if (ARRAY_BUFFER && (root.JS_SHA256_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) { ArrayBuffer.isView = function(t) { return typeof t === 'object' && t.buffer && t.buffer.constructor === ArrayBuffer; }; } var createOutputMethod = function(t, e) { return function(r) { return new Sha256(e, true).update(r)[t](); }; }; var createMethod = function(t) { var e = createOutputMethod('hex', t); if (NODE_JS) { e = nodeWrap(e, t); } e.create = function() { return new Sha256(t); }; e.update = function(t) { return e.create().update(t); }; for(var r = 0; r < OUTPUT_TYPES.length; ++r){ var n = OUTPUT_TYPES[r]; e[n] = createOutputMethod(n, t); } return e; }; var nodeWrap = function(method, is224) { var crypto = eval("require('crypto')"); var Buffer = eval("require('buffer').Buffer"); var algorithm = is224 ? 'sha224' : 'sha256'; var nodeMethod = function(t) { if (typeof t === 'string') { return crypto.createHash(algorithm).update(t, 'utf8').digest('hex'); } else { if (t === null || t === undefined) { throw new Error(ERROR); } else if (t.constructor === ArrayBuffer) { t = new Uint8Array(t); } } if (Array.isArray(t) || ArrayBuffer.isView(t) || t.constructor === Buffer) { return crypto.createHash(algorithm).update(new Buffer(t)).digest('hex'); } else { return method(t); } }; return nodeMethod; }; var createHmacOutputMethod = function(t, e) { return function(r, n) { return new HmacSha256(r, e, true).update(n)[t](); }; }; var createHmacMethod = function(t) { var e = createHmacOutputMethod('hex', t); e.create = function(e) { return new HmacSha256(e, t); }; e.update = function(t, r) { return e.create(t).update(r); }; for(var r = 0; r < OUTPUT_TYPES.length; ++r){ var n = OUTPUT_TYPES[r]; e[n] = createHmacOutputMethod(n, t); } return e; }; function Sha256(t, e) { if (e) { blocks[0] = blocks[16] = blocks[1] = blocks[2] = blocks[3] = blocks[4] = blocks[5] = blocks[6] = blocks[7] = blocks[8] = blocks[9] = blocks[10] = blocks[11] = blocks[12] = blocks[13] = blocks[14] = blocks[15] = 0; this.blocks = blocks; } else { this.blocks = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; } if (t) { this.h0 = 0xc1059ed8; this.h1 = 0x367cd507; this.h2 = 0x3070dd17; this.h3 = 0xf70e5939; this.h4 = 0xffc00b31; this.h5 = 0x68581511; this.h6 = 0x64f98fa7; this.h7 = 0xbefa4fa4; } else { this.h0 = 0x6a09e667; this.h1 = 0xbb67ae85; this.h2 = 0x3c6ef372; this.h3 = 0xa54ff53a; this.h4 = 0x510e527f; this.h5 = 0x9b05688c; this.h6 = 0x1f83d9ab; this.h7 = 0x5be0cd19; } this.block = this.start = this.bytes = this.hBytes = 0; this.finalized = this.hashed = false; this.first = true; this.is224 = t; } Sha256.prototype.update = function(t) { if (this.finalized) { return; } var e, r = typeof t; if (r !== 'string') { if (r === 'object') { if (t === null) { throw new Error(ERROR); } else if (ARRAY_BUFFER && t.constructor === ArrayBuffer) { t = new Uint8Array(t); } else if (!Array.isArray(t)) { if (!ARRAY_BUFFER || !ArrayBuffer.isView(t)) { throw new Error(ERROR); } } } else { throw new Error(ERROR); } e = true; } var n, i = 0, o, s = t.length, a = this.blocks; while(i < s){ if (this.hashed) { this.hashed = false; a[0] = this.block; a[16] = a[1] = a[2] = a[3] = a[4] = a[5] = a[6] = a[7] = a[8] = a[9] = a[10] = a[11] = a[12] = a[13] = a[14] = a[15] = 0; } if (e) { for(o = this.start; i < s && o < 64; ++i){ a[o >> 2] |= t[i] << SHIFT[o++ & 3]; } } else { for(o = this.start; i < s && o < 64; ++i){ n = t.charCodeAt(i); if (n < 0x80) { a[o >> 2] |= n << SHIFT[o++ & 3]; } else if (n < 0x800) { a[o >> 2] |= (0xc0 | (n >> 6)) << SHIFT[o++ & 3]; a[o >> 2] |= (0x80 | (n & 0x3f)) << SHIFT[o++ & 3]; } else if (n < 0xd800 || n >= 0xe000) { a[o >> 2] |= (0xe0 | (n >> 12)) << SHIFT[o++ & 3]; a[o >> 2] |= (0x80 | ((n >> 6) & 0x3f)) << SHIFT[o++ & 3]; a[o >> 2] |= (0x80 | (n & 0x3f)) << SHIFT[o++ & 3]; } else { n = 0x10000 + (((n & 0x3ff) << 10) | (t.charCodeAt(++i) & 0x3ff)); a[o >> 2] |= (0xf0 | (n >> 18)) << SHIFT[o++ & 3]; a[o >> 2] |= (0x80 | ((n >> 12) & 0x3f)) << SHIFT[o++ & 3]; a[o >> 2] |= (0x80 | ((n >> 6) & 0x3f)) << SHIFT[o++ & 3]; a[o >> 2] |= (0x80 | (n & 0x3f)) << SHIFT[o++ & 3]; } } } this.lastByteIndex = o; this.bytes += o - this.start; if (o >= 64) { this.block = a[16]; this.start = o - 64; this.hash(); this.hashed = true; } else { this.start = o; } } if (this.bytes > 4294967295) { this.hBytes += this.bytes / 4294967296 << 0; this.bytes = this.bytes % 4294967296; } return this; }; Sha256.prototype.finalize = function() { if (this.finalized) { return; } this.finalized = true; var t = this.blocks, e = this.lastByteIndex; t[16] = this.block; t[e >> 2] |= EXTRA[e & 3]; this.block = t[16]; if (e >= 56) { if (!this.hashed) { this.hash(); } t[0] = this.block; t[16] = t[1] = t[2] = t[3] = t[4] = t[5] = t[6] = t[7] = t[8] = t[9] = t[10] = t[11] = t[12] = t[13] = t[14] = t[15] = 0; } t[14] = this.hBytes << 3 | this.bytes >>> 29; t[15] = this.bytes << 3; this.hash(); }; Sha256.prototype.hash = function() { var t = this.h0, e = this.h1, r = this.h2, n = this.h3, i = this.h4, o = this.h5, s = this.h6, a = this.h7, f = this.blocks, u, c, l, h, d, p, g, b, v, y, m; for(u = 16; u < 64; ++u){ d = f[u - 15]; c = ((d >>> 7) | (d << 25)) ^ ((d >>> 18) | (d << 14)) ^ (d >>> 3); d = f[u - 2]; l = ((d >>> 17) | (d << 15)) ^ ((d >>> 19) | (d << 13)) ^ (d >>> 10); f[u] = f[u - 16] + c + f[u - 7] + l << 0; } m = e & r; for(u = 0; u < 64; u += 4){ if (this.first) { if (this.is224) { b = 300032; d = f[0] - 1413257819; a = d - 150054599 << 0; n = d + 24177077 << 0; } else { b = 704751109; d = f[0] - 210244248; a = d - 1521486534 << 0; n = d + 143694565 << 0; } this.first = false; } else { c = ((t >>> 2) | (t << 30)) ^ ((t >>> 13) | (t << 19)) ^ ((t >>> 22) | (t << 10)); l = ((i >>> 6) | (i << 26)) ^ ((i >>> 11) | (i << 21)) ^ ((i >>> 25) | (i << 7)); b = t & e; h = b ^ (t & r) ^ m; g = (i & o) ^ (~i & s); d = a + l + g + K[u] + f[u]; p = c + h; a = n + d << 0; n = d + p << 0; } c = ((n >>> 2) | (n << 30)) ^ ((n >>> 13) | (n << 19)) ^ ((n >>> 22) | (n << 10)); l = ((a >>> 6) | (a << 26)) ^ ((a >>> 11) | (a << 21)) ^ ((a >>> 25) | (a << 7)); v = n & t; h = v ^ (n & e) ^ b; g = (a & i) ^ (~a & o); d = s + l + g + K[u + 1] + f[u + 1]; p = c + h; s = r + d << 0; r = d + p << 0; c = ((r >>> 2) | (r << 30)) ^ ((r >>> 13) | (r << 19)) ^ ((r >>> 22) | (r << 10)); l = ((s >>> 6) | (s << 26)) ^ ((s >>> 11) | (s << 21)) ^ ((s >>> 25) | (s << 7)); y = r & n; h = y ^ (r & t) ^ v; g = (s & a) ^ (~s & i); d = o + l + g + K[u + 2] + f[u + 2]; p = c + h; o = e + d << 0; e = d + p << 0; c = ((e >>> 2) | (e << 30)) ^ ((e >>> 13) | (e << 19)) ^ ((e >>> 22) | (e << 10)); l = ((o >>> 6) | (o << 26)) ^ ((o >>> 11) | (o << 21)) ^ ((o >>> 25) | (o << 7)); m = e & r; h = m ^ (e & n) ^ y; g = (o & s) ^ (~o & a); d = i + l + g + K[u + 3] + f[u + 3]; p = c + h; i = t + d << 0; t = d + p << 0; } this.h0 = this.h0 + t << 0; this.h1 = this.h1 + e << 0; this.h2 = this.h2 + r << 0; this.h3 = this.h3 + n << 0; this.h4 = this.h4 + i << 0; this.h5 = this.h5 + o << 0; this.h6 = this.h6 + s << 0; this.h7 = this.h7 + a << 0; }; Sha256.prototype.hex = function() { this.finalize(); var t = this.h0, e = this.h1, r = this.h2, n = this.h3, i = this.h4, o = this.h5, s = this.h6, a = this.h7; var f = HEX_CHARS[(t >> 28) & 0x0F] + HEX_CHARS[(t >> 24) & 0x0F] + HEX_CHARS[(t >> 20) & 0x0F] + HEX_CHARS[(t >> 16) & 0x0F] + HEX_CHARS[(t >> 12) & 0x0F] + HEX_CHARS[(t >> 8) & 0x0F] + HEX_CHARS[(t >> 4) & 0x0F] + HEX_CHARS[t & 0x0F] + HEX_CHARS[(e >> 28) & 0x0F] + HEX_CHARS[(e >> 24) & 0x0F] + HEX_CHARS[(e >> 20) & 0x0F] + HEX_CHARS[(e >> 16) & 0x0F] + HEX_CHARS[(e >> 12) & 0x0F] + HEX_CHARS[(e >> 8) & 0x0F] + HEX_CHARS[(e >> 4) & 0x0F] + HEX_CHARS[e & 0x0F] + HEX_CHARS[(r >> 28) & 0x0F] + HEX_CHARS[(r >> 24) & 0x0F] + HEX_CHARS[(r >> 20) & 0x0F] + HEX_CHARS[(r >> 16) & 0x0F] + HEX_CHARS[(r >> 12) & 0x0F] + HEX_CHARS[(r >> 8) & 0x0F] + HEX_CHARS[(r >> 4) & 0x0F] + HEX_CHARS[r & 0x0F] + HEX_CHARS[(n >> 28) & 0x0F] + HEX_CHARS[(n >> 24) & 0x0F] + HEX_CHARS[(n >> 20) & 0x0F] + HEX_CHARS[(n >> 16) & 0x0F] + HEX_CHARS[(n >> 12) & 0x0F] + HEX_CHARS[(n >> 8) & 0x0F] + HEX_CHARS[(n >> 4) & 0x0F] + HEX_CHARS[n & 0x0F] + HEX_CHARS[(i >> 28) & 0x0F] + HEX_CHARS[(i >> 24) & 0x0F] + HEX_CHARS[(i >> 20) & 0x0F] + HEX_CHARS[(i >> 16) & 0x0F] + HEX_CHARS[(i >> 12) & 0x0F] + HEX_CHARS[(i >> 8) & 0x0F] + HEX_CHARS[(i >> 4) & 0x0F] + HEX_CHARS[i & 0x0F] + HEX_CHARS[(o >> 28) & 0x0F] + HEX_CHARS[(o >> 24) & 0x0F] + HEX_CHARS[(o >> 20) & 0x0F] + HEX_CHARS[(o >> 16) & 0x0F] + HEX_CHARS[(o >> 12) & 0x0F] + HEX_CHARS[(o >> 8) & 0x0F] + HEX_CHARS[(o >> 4) & 0x0F] + HEX_CHARS[o & 0x0F] + HEX_CHARS[(s >> 28) & 0x0F] + HEX_CHARS[(s >> 24) & 0x0F] + HEX_CHARS[(s >> 20) & 0x0F] + HEX_CHARS[(s >> 16) & 0x0F] + HEX_CHARS[(s >> 12) & 0x0F] + HEX_CHARS[(s >> 8) & 0x0F] + HEX_CHARS[(s >> 4) & 0x0F] + HEX_CHARS[s & 0x0F]; if (!this.is224) { f += HEX_CHARS[(a >> 28) & 0x0F] + HEX_CHARS[(a >> 24) & 0x0F] + HEX_CHARS[(a >> 20) & 0x0F] + HEX_CHARS[(a >> 16) & 0x0F] + HEX_CHARS[(a >> 12) & 0x0F] + HEX_CHARS[(a >> 8) & 0x0F] + HEX_CHARS[(a >> 4) & 0x0F] + HEX_CHARS[a & 0x0F]; } return f; }; Sha256.prototype.toString = Sha256.prototype.hex; Sha256.prototype.digest = function() { this.finalize(); var t = this.h0, e = this.h1, r = this.h2, n = this.h3, i = this.h4, o = this.h5, s = this.h6, a = this.h7; var f = [ (t >> 24) & 0xFF, (t >> 16) & 0xFF, (t >> 8) & 0xFF, t & 0xFF, (e >> 24) & 0xFF, (e >> 16) & 0xFF, (e >> 8) & 0xFF, e & 0xFF, (r >> 24) & 0xFF, (r >> 16) & 0xFF, (r >> 8) & 0xFF, r & 0xFF, (n >> 24) & 0xFF, (n >> 16) & 0xFF, (n >> 8) & 0xFF, n & 0xFF, (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF, (o >> 24) & 0xFF, (o >> 16) & 0xFF, (o >> 8) & 0xFF, o & 0xFF, (s >> 24) & 0xFF, (s >> 16) & 0xFF, (s >> 8) & 0xFF, s & 0xFF ]; if (!this.is224) { f.push((a >> 24) & 0xFF, (a >> 16) & 0xFF, (a >> 8) & 0xFF, a & 0xFF); } return f; }; Sha256.prototype.array = Sha256.prototype.digest; Sha256.prototype.arrayBuffer = function() { this.finalize(); var t = new ArrayBuffer(this.is224 ? 28 : 32); var e = new DataView(t); e.setUint32(0, this.h0); e.setUint32(4, this.h1); e.setUint32(8, this.h2); e.setUint32(12, this.h3); e.setUint32(16, this.h4); e.setUint32(20, this.h5); e.setUint32(24, this.h6); if (!this.is224) { e.setUint32(28, this.h7); } return t; }; function HmacSha256(t, e, r) { var n, i = typeof t; if (i === 'string') { var o = [], s = t.length, a = 0, f; for(n = 0; n < s; ++n){ f = t.charCodeAt(n); if (f < 0x80) { o[a++] = f; } else if (f < 0x800) { o[a++] = (0xc0 | (f >> 6)); o[a++] = (0x80 | (f & 0x3f)); } else if (f < 0xd800 || f >= 0xe000) { o[a++] = (0xe0 | (f >> 12)); o[a++] = (0x80 | ((f >> 6) & 0x3f)); o[a++] = (0x80 | (f & 0x3f)); } else { f = 0x10000 + (((f & 0x3ff) << 10) | (t.charCodeAt(++n) & 0x3ff)); o[a++] = (0xf0 | (f >> 18)); o[a++] = (0x80 | ((f >> 12) & 0x3f)); o[a++] = (0x80 | ((f >> 6) & 0x3f)); o[a++] = (0x80 | (f & 0x3f)); } } t = o; } else { if (i === 'object') { if (t === null) { throw new Error(ERROR); } else if (ARRAY_BUFFER && t.constructor === ArrayBuffer) { t = new Uint8Array(t); } else if (!Array.isArray(t)) { if (!ARRAY_BUFFER || !ArrayBuffer.isView(t)) { throw new Error(ERROR); } } } else { throw new Error(ERROR); } } if (t.length > 64) { t = (new Sha256(e, true)).update(t).array(); } var u = [], c = []; for(n = 0; n < 64; ++n){ var l = t[n] || 0; u[n] = 0x5c ^ l; c[n] = 0x36 ^ l; } Sha256.call(this, e, r); this.update(c); this.oKeyPad = u; this.inner = true; this.sharedMemory = r; } HmacSha256.prototype = new Sha256(); HmacSha256.prototype.finalize = function() { Sha256.prototype.finalize.call(this); if (this.inner) { this.inner = false; var t = this.array(); Sha256.call(this, this.is224, this.sharedMemory); this.update(this.oKeyPad); this.update(t); Sha256.prototype.finalize.call(this); } }; var exports = createMethod(); exports.sha256 = exports; exports.sha224 = createMethod(true); exports.sha256.hmac = createHmacMethod(); exports.sha224.hmac = createHmacMethod(true); if (COMMON_JS) { module.exports = exports; } else { root.sha256 = exports.sha256; root.sha224 = exports.sha224; if (AMD) { !(__WEBPACK_AMD_DEFINE_RESULT__ = (function() { return exports; }).call(exports, __webpack_require__, exports, module), __WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__)); } } })(); }), 3434: (function(t, e, r) { var n = r(3454); var i; (function() { 'use strict'; var e = 'input is invalid type'; var o = 'finalize already called'; var s = typeof window === 'object'; var a = s ? window : {}; if (a.JS_SHA512_NO_WINDOW) { s = false; } var f = !s && typeof self === 'object'; var u = !a.JS_SHA512_NO_NODE_JS && typeof n === 'object' && n.versions && n.versions.node; if (u) { a = r.g; } else if (f) { a = self; } var c = !a.JS_SHA512_NO_COMMON_JS && "object" === 'object' && t.exports; var l = true && r.amdO; var h = !a.JS_SHA512_NO_ARRAY_BUFFER && typeof ArrayBuffer !== 'undefined'; var d = '0123456789abcdef'.split(''); var p = [ -2147483648, 8388608, 32768, 128 ]; var g = [ 24, 16, 8, 0 ]; var b = [ 0x428A2F98, 0xD728AE22, 0x71374491, 0x23EF65CD, 0xB5C0FBCF, 0xEC4D3B2F, 0xE9B5DBA5, 0x8189DBBC, 0x3956C25B, 0xF348B538, 0x59F111F1, 0xB605D019, 0x923F82A4, 0xAF194F9B, 0xAB1C5ED5, 0xDA6D8118, 0xD807AA98, 0xA3030242, 0x12835B01, 0x45706FBE, 0x243185BE, 0x4EE4B28C, 0x550C7DC3, 0xD5FFB4E2, 0x72BE5D74, 0xF27B896F, 0x80DEB1FE, 0x3B1696B1, 0x9BDC06A7, 0x25C71235, 0xC19BF174, 0xCF692694, 0xE49B69C1, 0x9EF14AD2, 0xEFBE4786, 0x384F25E3, 0x0FC19DC6, 0x8B8CD5B5, 0x240CA1CC, 0x77AC9C65, 0x2DE92C6F, 0x592B0275, 0x4A7484AA, 0x6EA6E483, 0x5CB0A9DC, 0xBD41FBD4, 0x76F988DA, 0x831153B5, 0x983E5152, 0xEE66DFAB, 0xA831C66D, 0x2DB43210, 0xB00327C8, 0x98FB213F, 0xBF597FC7, 0xBEEF0EE4, 0xC6E00BF3, 0x3DA88FC2, 0xD5A79147, 0x930AA725, 0x06CA6351, 0xE003826F, 0x14292967, 0x0A0E6E70, 0x27B70A85, 0x46D22FFC, 0x2E1B2138, 0x5C26C926, 0x4D2C6DFC, 0x5AC42AED, 0x53380D13, 0x9D95B3DF, 0x650A7354, 0x8BAF63DE, 0x766A0ABB, 0x3C77B2A8, 0x81C2C92E, 0x47EDAEE6, 0x92722C85, 0x1482353B, 0xA2BFE8A1, 0x4CF10364, 0xA81A664B, 0xBC423001, 0xC24B8B70, 0xD0F89791, 0xC76C51A3, 0x0654BE30, 0xD192E819, 0xD6EF5218, 0xD6990624, 0x5565A910, 0xF40E3585, 0x5771202A, 0x106AA070, 0x32BBD1B8, 0x19A4C116, 0xB8D2D0C8, 0x1E376C08, 0x5141AB53, 0x2748774C, 0xDF8EEB99, 0x34B0BCB5, 0xE19B48A8, 0x391C0CB3, 0xC5C95A63, 0x4ED8AA4A, 0xE3418ACB, 0x5B9CCA4F, 0x7763E373, 0x682E6FF3, 0xD6B2B8A3, 0x748F82EE, 0x5DEFB2FC, 0x78A5636F, 0x43172F60, 0x84C87814, 0xA1F0AB72, 0x8CC70208, 0x1A6439EC, 0x90BEFFFA, 0x23631E28, 0xA4506CEB, 0xDE82BDE9, 0xBEF9A3F7, 0xB2C67915, 0xC67178F2, 0xE372532B, 0xCA273ECE, 0xEA26619C, 0xD186B8C7, 0x21C0C207, 0xEADA7DD6, 0xCDE0EB1E, 0xF57D4F7F, 0xEE6ED178, 0x06F067AA, 0x72176FBA, 0x0A637DC5, 0xA2C898A6, 0x113F9804, 0xBEF90DAE, 0x1B710B35, 0x131C471B, 0x28DB77F5, 0x23047D84, 0x32CAAB7B, 0x40C72493, 0x3C9EBE0A, 0x15C9BEBC, 0x431D67C4, 0x9C100D4C, 0x4CC5D4BE, 0xCB3E42B6, 0x597F299C, 0xFC657E2A, 0x5FCB6FAB, 0x3AD6FAEC, 0x6C44198C, 0x4A475817 ]; var v = [ 'hex', 'array', 'digest', 'arrayBuffer' ]; var y = []; if (a.JS_SHA512_NO_NODE_JS || !Array.isArray) { Array.isArray = function(t) { return Object.prototype.toString.call(t) === '[object Array]'; }; } if (h && (a.JS_SHA512_NO_ARRAY_BUFFER_IS_VIEW || !ArrayBuffer.isView)) { ArrayBuffer.isView = function(t) { return typeof t === 'object' && t.buffer && t.buffer.constructor === ArrayBuffer; }; } var m = function(t, e) { return function(r) { return new E(e, true).update(r)[t](); }; }; var w = function(t) { var e = m('hex', t); e.create = function() { return new E(t); }; e.update = function(t) { return e.create().update(t); }; for(var r = 0; r < v.length; ++r){ var n = v[r]; e[n] = m(n, t); } return e; }; var _ = function(t, e) { return function(r, n) { return new x(r, e, true).update(n)[t](); }; }; var S = function(t) { var e = _('hex', t); e.create = function(e) { return new x(e, t); }; e.update = function(t, r) { return e.create(t).update(r); }; for(var r = 0; r < v.length; ++r){ var n = v[r]; e[n] = _(n, t); } return e; }; function E(t, e) { if (e) { y[0] = y[1] = y[2] = y[3] = y[4] = y[5] = y[6] = y[7] = y[8] = y[9] = y[10] = y[11] = y[12] = y[13] = y[14] = y[15] = y[16] = y[17] = y[18] = y[19] = y[20] = y[21] = y[22] = y[23] = y[24] = y[25] = y[26] = y[27] = y[28] = y[29] = y[30] = y[31] = y[32] = 0; this.blocks = y; } else { this.blocks = [ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 ]; } if (t == 384) { this.h0h = 0xCBBB9D5D; this.h0l = 0xC1059ED8; this.h1h = 0x629A292A; this.h1l = 0x367CD507; this.h2h = 0x9159015A; this.h2l = 0x3070DD17; this.h3h = 0x152FECD8; this.h3l = 0xF70E5939; this.h4h = 0x67332667; this.h4l = 0xFFC00B31; this.h5h = 0x8EB44A87; this.h5l = 0x68581511; this.h6h = 0xDB0C2E0D; this.h6l = 0x64F98FA7; this.h7h = 0x47B5481D; this.h7l = 0xBEFA4FA4; } else if (t == 256) { this.h0h = 0x22312194; this.h0l = 0xFC2BF72C; this.h1h = 0x9F555FA3; this.h1l = 0xC84C64C2; this.h2h = 0x2393B86B; this.h2l = 0x6F53B151; this.h3h = 0x96387719; this.h3l = 0x5940EABD; this.h4h = 0x96283EE2; this.h4l = 0xA88EFFE3; this.h5h = 0xBE5E1E25; this.h5l = 0x53863992; this.h6h = 0x2B0199FC; this.h6l = 0x2C85B8AA; this.h7h = 0x0EB72DDC; this.h7l = 0x81C52CA2; } else if (t == 224) { this.h0h = 0x8C3D37C8; this.h0l = 0x19544DA2; this.h1h = 0x73E19966; this.h1l = 0x89DCD4D6; this.h2h = 0x1DFAB7AE; this.h2l = 0x32FF9C82; this.h3h = 0x679DD514; this.h3l = 0x582F9FCF; this.h4h = 0x0F6D2B69; this.h4l = 0x7BD44DA8; this.h5h = 0x77E36F73; this.h5l = 0x04C48942; this.h6h = 0x3F9D85A8; this.h6l = 0x6A1D36C8; this.h7h = 0x1112E6AD; this.h7l = 0x91D692A1; } else { this.h0h = 0x6A09E667; this.h0l = 0xF3BCC908; this.h1h = 0xBB67AE85; this.h1l = 0x84CAA73B; this.h2h = 0x3C6EF372; this.h2l = 0xFE94F82B; this.h3h = 0xA54FF53A; this.h3l = 0x5F1D36F1; this.h4h = 0x510E527F; this.h4l = 0xADE682D1; this.h5h = 0x9B05688C; this.h5l = 0x2B3E6C1F; this.h6h = 0x1F83D9AB; this.h6l = 0xFB41BD6B; this.h7h = 0x5BE0CD19; this.h7l = 0x137E2179; } this.bits = t; this.block = this.start = this.bytes = this.hBytes = 0; this.finalized = this.hashed = false; } E.prototype.update = function(t) { if (this.finalized) { throw new Error(o); } var r, n = typeof t; if (n !== 'string') { if (n === 'object') { if (t === null) { throw new Error(e); } else if (h && t.constructor === ArrayBuffer) { t = new Uint8Array(t); } else if (!Array.isArray(t)) { if (!h || !ArrayBuffer.isView(t)) { throw new Error(e); } } } else { throw new Error(e); } r = true; } var i, s = 0, a, f = t.length, u = this.blocks; while(s < f){ if (this.hashed) { this.hashed = false; u[0] = this.block; u[1] = u[2] = u[3] = u[4] = u[5] = u[6] = u[7] = u[8] = u[9] = u[10] = u[11] = u[12] = u[13] = u[14] = u[15] = u[16] = u[17] = u[18] = u[19] = u[20] = u[21] = u[22] = u[23] = u[24] = u[25] = u[26] = u[27] = u[28] = u[29] = u[30] = u[31] = u[32] = 0; } if (r) { for(a = this.start; s < f && a < 128; ++s){ u[a >> 2] |= t[s] << g[a++ & 3]; } } else { for(a = this.start; s < f && a < 128; ++s){ i = t.charCodeAt(s); if (i < 0x80) { u[a >> 2] |= i << g[a++ & 3]; } else if (i < 0x800) { u[a >> 2] |= (0xc0 | (i >> 6)) << g[a++ & 3]; u[a >> 2] |= (0x80 | (i & 0x3f)) << g[a++ & 3]; } else if (i < 0xd800 || i >= 0xe000) { u[a >> 2] |= (0xe0 | (i >> 12)) << g[a++ & 3]; u[a >> 2] |= (0x80 | ((i >> 6) & 0x3f)) << g[a++ & 3]; u[a >> 2] |= (0x80 | (i & 0x3f)) << g[a++ & 3]; } else { i = 0x10000 + (((i & 0x3ff) << 10) | (t.charCodeAt(++s) & 0x3ff)); u[a >> 2] |= (0xf0 | (i >> 18)) << g[a++ & 3]; u[a >> 2] |= (0x80 | ((i >> 12) & 0x3f)) << g[a++ & 3]; u[a >> 2] |= (0x80 | ((i >> 6) & 0x3f)) << g[a++ & 3]; u[a >> 2] |= (0x80 | (i & 0x3f)) << g[a++ & 3]; } } } this.lastByteIndex = a; this.bytes += a - this.start; if (a >= 128) { this.block = u[32]; this.start = a - 128; this.hash(); this.hashed = true; } else { this.start = a; } } if (this.bytes > 4294967295) { this.hBytes += this.bytes / 4294967296 << 0; this.bytes = this.bytes % 4294967296; } return this; }; E.prototype.finalize = function() { if (this.finalized) { return; } this.finalized = true; var t = this.blocks, e = this.lastByteIndex; t[32] = this.block; t[e >> 2] |= p[e & 3]; this.block = t[32]; if (e >= 112) { if (!this.hashed) { this.hash(); } t[0] = this.block; t[1] = t[2] = t[3] = t[4] = t[5] = t[6] = t[7] = t[8] = t[9] = t[10] = t[11] = t[12] = t[13] = t[14] = t[15] = t[16] = t[17] = t[18] = t[19] = t[20] = t[21] = t[22] = t[23] = t[24] = t[25] = t[26] = t[27] = t[28] = t[29] = t[30] = t[31] = t[32] = 0; } t[30] = this.hBytes << 3 | this.bytes >>> 29; t[31] = this.bytes << 3; this.hash(); }; E.prototype.hash = function() { var t = this.h0h, e = this.h0l, r = this.h1h, n = this.h1l, i = this.h2h, o = this.h2l, s = this.h3h, a = this.h3l, f = this.h4h, u = this.h4l, c = this.h5h, l = this.h5l, h = this.h6h, d = this.h6l, p = this.h7h, g = this.h7l, v = this.blocks, y, m, w, _, S, E, x, M, T, A, O, k, I, R, N, j, P, C, B, L, U, D, $, F, W; for(y = 32; y < 160; y += 2){ L = v[y - 30]; U = v[y - 29]; m = ((L >>> 1) | (U << 31)) ^ ((L >>> 8) | (U << 24)) ^ (L >>> 7); w = ((U >>> 1) | (L << 31)) ^ ((U >>> 8) | (L << 24)) ^ ((U >>> 7) | L << 25); L = v[y - 4]; U = v[y - 3]; _ = ((L >>> 19) | (U << 13)) ^ ((U >>> 29) | (L << 3)) ^ (L >>> 6); S = ((U >>> 19) | (L << 13)) ^ ((L >>> 29) | (U << 3)) ^ ((U >>> 6) | L << 26); L = v[y - 32]; U = v[y - 31]; D = v[y - 14]; $ = v[y - 13]; E = ($ & 0xFFFF) + (U & 0xFFFF) + (w & 0xFFFF) + (S & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (w >>> 16) + (S >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (m & 0xFFFF) + (_ & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (m >>> 16) + (_ >>> 16) + (M >>> 16); v[y] = (T << 16) | (M & 0xFFFF); v[y + 1] = (x << 16) | (E & 0xFFFF); } var q = t, z = e, G = r, K = n, V = i, H = o, J = s, X = a, Y = f, Z = u, Q = c, tt = l, te = h, tr = d, tn = p, ti = g; j = G & V; P = K & H; for(y = 0; y < 160; y += 8){ m = ((q >>> 28) | (z << 4)) ^ ((z >>> 2) | (q << 30)) ^ ((z >>> 7) | (q << 25)); w = ((z >>> 28) | (q << 4)) ^ ((q >>> 2) | (z << 30)) ^ ((q >>> 7) | (z << 25)); _ = ((Y >>> 14) | (Z << 18)) ^ ((Y >>> 18) | (Z << 14)) ^ ((Z >>> 9) | (Y << 23)); S = ((Z >>> 14) | (Y << 18)) ^ ((Z >>> 18) | (Y << 14)) ^ ((Y >>> 9) | (Z << 23)); A = q & G; O = z & K; C = A ^ (q & V) ^ j; B = O ^ (z & H) ^ P; F = (Y & Q) ^ (~Y & te); W = (Z & tt) ^ (~Z & tr); L = v[y]; U = v[y + 1]; D = b[y]; $ = b[y + 1]; E = ($ & 0xFFFF) + (U & 0xFFFF) + (W & 0xFFFF) + (S & 0xFFFF) + (ti & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (W >>> 16) + (S >>> 16) + (ti >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (F & 0xFFFF) + (_ & 0xFFFF) + (tn & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (F >>> 16) + (_ >>> 16) + (tn >>> 16) + (M >>> 16); L = (T << 16) | (M & 0xFFFF); U = (x << 16) | (E & 0xFFFF); E = (B & 0xFFFF) + (w & 0xFFFF); x = (B >>> 16) + (w >>> 16) + (E >>> 16); M = (C & 0xFFFF) + (m & 0xFFFF) + (x >>> 16); T = (C >>> 16) + (m >>> 16) + (M >>> 16); D = (T << 16) | (M & 0xFFFF); $ = (x << 16) | (E & 0xFFFF); E = (X & 0xFFFF) + (U & 0xFFFF); x = (X >>> 16) + (U >>> 16) + (E >>> 16); M = (J & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (J >>> 16) + (L >>> 16) + (M >>> 16); tn = (T << 16) | (M & 0xFFFF); ti = (x << 16) | (E & 0xFFFF); E = ($ & 0xFFFF) + (U & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (M >>> 16); J = (T << 16) | (M & 0xFFFF); X = (x << 16) | (E & 0xFFFF); m = ((J >>> 28) | (X << 4)) ^ ((X >>> 2) | (J << 30)) ^ ((X >>> 7) | (J << 25)); w = ((X >>> 28) | (J << 4)) ^ ((J >>> 2) | (X << 30)) ^ ((J >>> 7) | (X << 25)); _ = ((tn >>> 14) | (ti << 18)) ^ ((tn >>> 18) | (ti << 14)) ^ ((ti >>> 9) | (tn << 23)); S = ((ti >>> 14) | (tn << 18)) ^ ((ti >>> 18) | (tn << 14)) ^ ((tn >>> 9) | (ti << 23)); k = J & q; I = X & z; C = k ^ (J & G) ^ A; B = I ^ (X & K) ^ O; F = (tn & Y) ^ (~tn & Q); W = (ti & Z) ^ (~ti & tt); L = v[y + 2]; U = v[y + 3]; D = b[y + 2]; $ = b[y + 3]; E = ($ & 0xFFFF) + (U & 0xFFFF) + (W & 0xFFFF) + (S & 0xFFFF) + (tr & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (W >>> 16) + (S >>> 16) + (tr >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (F & 0xFFFF) + (_ & 0xFFFF) + (te & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (F >>> 16) + (_ >>> 16) + (te >>> 16) + (M >>> 16); L = (T << 16) | (M & 0xFFFF); U = (x << 16) | (E & 0xFFFF); E = (B & 0xFFFF) + (w & 0xFFFF); x = (B >>> 16) + (w >>> 16) + (E >>> 16); M = (C & 0xFFFF) + (m & 0xFFFF) + (x >>> 16); T = (C >>> 16) + (m >>> 16) + (M >>> 16); D = (T << 16) | (M & 0xFFFF); $ = (x << 16) | (E & 0xFFFF); E = (H & 0xFFFF) + (U & 0xFFFF); x = (H >>> 16) + (U >>> 16) + (E >>> 16); M = (V & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (V >>> 16) + (L >>> 16) + (M >>> 16); te = (T << 16) | (M & 0xFFFF); tr = (x << 16) | (E & 0xFFFF); E = ($ & 0xFFFF) + (U & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (M >>> 16); V = (T << 16) | (M & 0xFFFF); H = (x << 16) | (E & 0xFFFF); m = ((V >>> 28) | (H << 4)) ^ ((H >>> 2) | (V << 30)) ^ ((H >>> 7) | (V << 25)); w = ((H >>> 28) | (V << 4)) ^ ((V >>> 2) | (H << 30)) ^ ((V >>> 7) | (H << 25)); _ = ((te >>> 14) | (tr << 18)) ^ ((te >>> 18) | (tr << 14)) ^ ((tr >>> 9) | (te << 23)); S = ((tr >>> 14) | (te << 18)) ^ ((tr >>> 18) | (te << 14)) ^ ((te >>> 9) | (tr << 23)); R = V & J; N = H & X; C = R ^ (V & q) ^ k; B = N ^ (H & z) ^ I; F = (te & tn) ^ (~te & Y); W = (tr & ti) ^ (~tr & Z); L = v[y + 4]; U = v[y + 5]; D = b[y + 4]; $ = b[y + 5]; E = ($ & 0xFFFF) + (U & 0xFFFF) + (W & 0xFFFF) + (S & 0xFFFF) + (tt & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (W >>> 16) + (S >>> 16) + (tt >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (F & 0xFFFF) + (_ & 0xFFFF) + (Q & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (F >>> 16) + (_ >>> 16) + (Q >>> 16) + (M >>> 16); L = (T << 16) | (M & 0xFFFF); U = (x << 16) | (E & 0xFFFF); E = (B & 0xFFFF) + (w & 0xFFFF); x = (B >>> 16) + (w >>> 16) + (E >>> 16); M = (C & 0xFFFF) + (m & 0xFFFF) + (x >>> 16); T = (C >>> 16) + (m >>> 16) + (M >>> 16); D = (T << 16) | (M & 0xFFFF); $ = (x << 16) | (E & 0xFFFF); E = (K & 0xFFFF) + (U & 0xFFFF); x = (K >>> 16) + (U >>> 16) + (E >>> 16); M = (G & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (G >>> 16) + (L >>> 16) + (M >>> 16); Q = (T << 16) | (M & 0xFFFF); tt = (x << 16) | (E & 0xFFFF); E = ($ & 0xFFFF) + (U & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (M >>> 16); G = (T << 16) | (M & 0xFFFF); K = (x << 16) | (E & 0xFFFF); m = ((G >>> 28) | (K << 4)) ^ ((K >>> 2) | (G << 30)) ^ ((K >>> 7) | (G << 25)); w = ((K >>> 28) | (G << 4)) ^ ((G >>> 2) | (K << 30)) ^ ((G >>> 7) | (K << 25)); _ = ((Q >>> 14) | (tt << 18)) ^ ((Q >>> 18) | (tt << 14)) ^ ((tt >>> 9) | (Q << 23)); S = ((tt >>> 14) | (Q << 18)) ^ ((tt >>> 18) | (Q << 14)) ^ ((Q >>> 9) | (tt << 23)); j = G & V; P = K & H; C = j ^ (G & J) ^ R; B = P ^ (K & X) ^ N; F = (Q & te) ^ (~Q & tn); W = (tt & tr) ^ (~tt & ti); L = v[y + 6]; U = v[y + 7]; D = b[y + 6]; $ = b[y + 7]; E = ($ & 0xFFFF) + (U & 0xFFFF) + (W & 0xFFFF) + (S & 0xFFFF) + (Z & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (W >>> 16) + (S >>> 16) + (Z >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (F & 0xFFFF) + (_ & 0xFFFF) + (Y & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (F >>> 16) + (_ >>> 16) + (Y >>> 16) + (M >>> 16); L = (T << 16) | (M & 0xFFFF); U = (x << 16) | (E & 0xFFFF); E = (B & 0xFFFF) + (w & 0xFFFF); x = (B >>> 16) + (w >>> 16) + (E >>> 16); M = (C & 0xFFFF) + (m & 0xFFFF) + (x >>> 16); T = (C >>> 16) + (m >>> 16) + (M >>> 16); D = (T << 16) | (M & 0xFFFF); $ = (x << 16) | (E & 0xFFFF); E = (z & 0xFFFF) + (U & 0xFFFF); x = (z >>> 16) + (U >>> 16) + (E >>> 16); M = (q & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (q >>> 16) + (L >>> 16) + (M >>> 16); Y = (T << 16) | (M & 0xFFFF); Z = (x << 16) | (E & 0xFFFF); E = ($ & 0xFFFF) + (U & 0xFFFF); x = ($ >>> 16) + (U >>> 16) + (E >>> 16); M = (D & 0xFFFF) + (L & 0xFFFF) + (x >>> 16); T = (D >>> 16) + (L >>> 16) + (M >>> 16); q = (T << 16) | (M & 0xFFFF); z = (x << 16) | (E & 0xFFFF); } E = (e & 0xFFFF) + (z & 0xFFFF); x = (e >>> 16) + (z >>> 16) + (E >>> 16); M = (t & 0xFFFF) + (q & 0xFFFF) + (x >>> 16); T = (t >>> 16) + (q >>> 16) + (M >>> 16); this.h0h = (T << 16) | (M & 0xFFFF); this.h0l = (x << 16) | (E & 0xFFFF); E = (n & 0xFFFF) + (K & 0xFFFF); x = (n >>> 16) + (K >>> 16) + (E >>> 16); M = (r & 0xFFFF) + (G & 0xFFFF) + (x >>> 16); T = (r >>> 16) + (G >>> 16) + (M >>> 16); this.h1h = (T << 16) | (M & 0xFFFF); this.h1l = (x << 16) | (E & 0xFFFF); E = (o & 0xFFFF) + (H & 0xFFFF); x = (o >>> 16) + (H >>> 16) + (E >>> 16); M = (i & 0xFFFF) + (V & 0xFFFF) + (x >>> 16); T = (i >>> 16) + (V >>> 16) + (M >>> 16); this.h2h = (T << 16) | (M & 0xFFFF); this.h2l = (x << 16) | (E & 0xFFFF); E = (a & 0xFFFF) + (X & 0xFFFF); x = (a >>> 16) + (X >>> 16) + (E >>> 16); M = (s & 0xFFFF) + (J & 0xFFFF) + (x >>> 16); T = (s >>> 16) + (J >>> 16) + (M >>> 16); this.h3h = (T << 16) | (M & 0xFFFF); this.h3l = (x << 16) | (E & 0xFFFF); E = (u & 0xFFFF) + (Z & 0xFFFF); x = (u >>> 16) + (Z >>> 16) + (E >>> 16); M = (f & 0xFFFF) + (Y & 0xFFFF) + (x >>> 16); T = (f >>> 16) + (Y >>> 16) + (M >>> 16); this.h4h = (T << 16) | (M & 0xFFFF); this.h4l = (x << 16) | (E & 0xFFFF); E = (l & 0xFFFF) + (tt & 0xFFFF); x = (l >>> 16) + (tt >>> 16) + (E >>> 16); M = (c & 0xFFFF) + (Q & 0xFFFF) + (x >>> 16); T = (c >>> 16) + (Q >>> 16) + (M >>> 16); this.h5h = (T << 16) | (M & 0xFFFF); this.h5l = (x << 16) | (E & 0xFFFF); E = (d & 0xFFFF) + (tr & 0xFFFF); x = (d >>> 16) + (tr >>> 16) + (E >>> 16); M = (h & 0xFFFF) + (te & 0xFFFF) + (x >>> 16); T = (h >>> 16) + (te >>> 16) + (M >>> 16); this.h6h = (T << 16) | (M & 0xFFFF); this.h6l = (x << 16) | (E & 0xFFFF); E = (g & 0xFFFF) + (ti & 0xFFFF); x = (g >>> 16) + (ti >>> 16) + (E >>> 16); M = (p & 0xFFFF) + (tn & 0xFFFF) + (x >>> 16); T = (p >>> 16) + (tn >>> 16) + (M >>> 16); this.h7h = (T << 16) | (M & 0xFFFF); this.h7l = (x << 16) | (E & 0xFFFF); }; E.prototype.hex = function() { this.finalize(); var t = this.h0h, e = this.h0l, r = this.h1h, n = this.h1l, i = this.h2h, o = this.h2l, s = this.h3h, a = this.h3l, f = this.h4h, u = this.h4l, c = this.h5h, l = this.h5l, h = this.h6h, p = this.h6l, g = this.h7h, b = this.h7l, v = this.bits; var y = d[(t >> 28) & 0x0F] + d[(t >> 24) & 0x0F] + d[(t >> 20) & 0x0F] + d[(t >> 16) & 0x0F] + d[(t >> 12) & 0x0F] + d[(t >> 8) & 0x0F] + d[(t >> 4) & 0x0F] + d[t & 0x0F] + d[(e >> 28) & 0x0F] + d[(e >> 24) & 0x0F] + d[(e >> 20) & 0x0F] + d[(e >> 16) & 0x0F] + d[(e >> 12) & 0x0F] + d[(e >> 8) & 0x0F] + d[(e >> 4) & 0x0F] + d[e & 0x0F] + d[(r >> 28) & 0x0F] + d[(r >> 24) & 0x0F] + d[(r >> 20) & 0x0F] + d[(r >> 16) & 0x0F] + d[(r >> 12) & 0x0F] + d[(r >> 8) & 0x0F] + d[(r >> 4) & 0x0F] + d[r & 0x0F] + d[(n >> 28) & 0x0F] + d[(n >> 24) & 0x0F] + d[(n >> 20) & 0x0F] + d[(n >> 16) & 0x0F] + d[(n >> 12) & 0x0F] + d[(n >> 8) & 0x0F] + d[(n >> 4) & 0x0F] + d[n & 0x0F] + d[(i >> 28) & 0x0F] + d[(i >> 24) & 0x0F] + d[(i >> 20) & 0x0F] + d[(i >> 16) & 0x0F] + d[(i >> 12) & 0x0F] + d[(i >> 8) & 0x0F] + d[(i >> 4) & 0x0F] + d[i & 0x0F] + d[(o >> 28) & 0x0F] + d[(o >> 24) & 0x0F] + d[(o >> 20) & 0x0F] + d[(o >> 16) & 0x0F] + d[(o >> 12) & 0x0F] + d[(o >> 8) & 0x0F] + d[(o >> 4) & 0x0F] + d[o & 0x0F] + d[(s >> 28) & 0x0F] + d[(s >> 24) & 0x0F] + d[(s >> 20) & 0x0F] + d[(s >> 16) & 0x0F] + d[(s >> 12) & 0x0F] + d[(s >> 8) & 0x0F] + d[(s >> 4) & 0x0F] + d[s & 0x0F]; if (v >= 256) { y += d[(a >> 28) & 0x0F] + d[(a >> 24) & 0x0F] + d[(a >> 20) & 0x0F] + d[(a >> 16) & 0x0F] + d[(a >> 12) & 0x0F] + d[(a >> 8) & 0x0F] + d[(a >> 4) & 0x0F] + d[a & 0x0F]; } if (v >= 384) { y += d[(f >> 28) & 0x0F] + d[(f >> 24) & 0x0F] + d[(f >> 20) & 0x0F] + d[(f >> 16) & 0x0F] + d[(f >> 12) & 0x0F] + d[(f >> 8) & 0x0F] + d[(f >> 4) & 0x0F] + d[f & 0x0F] + d[(u >> 28) & 0x0F] + d[(u >> 24) & 0x0F] + d[(u >> 20) & 0x0F] + d[(u >> 16) & 0x0F] + d[(u >> 12) & 0x0F] + d[(u >> 8) & 0x0F] + d[(u >> 4) & 0x0F] + d[u & 0x0F] + d[(c >> 28) & 0x0F] + d[(c >> 24) & 0x0F] + d[(c >> 20) & 0x0F] + d[(c >> 16) & 0x0F] + d[(c >> 12) & 0x0F] + d[(c >> 8) & 0x0F] + d[(c >> 4) & 0x0F] + d[c & 0x0F] + d[(l >> 28) & 0x0F] + d[(l >> 24) & 0x0F] + d[(l >> 20) & 0x0F] + d[(l >> 16) & 0x0F] + d[(l >> 12) & 0x0F] + d[(l >> 8) & 0x0F] + d[(l >> 4) & 0x0F] + d[l & 0x0F]; } if (v == 512) { y += d[(h >> 28) & 0x0F] + d[(h >> 24) & 0x0F] + d[(h >> 20) & 0x0F] + d[(h >> 16) & 0x0F] + d[(h >> 12) & 0x0F] + d[(h >> 8) & 0x0F] + d[(h >> 4) & 0x0F] + d[h & 0x0F] + d[(p >> 28) & 0x0F] + d[(p >> 24) & 0x0F] + d[(p >> 20) & 0x0F] + d[(p >> 16) & 0x0F] + d[(p >> 12) & 0x0F] + d[(p >> 8) & 0x0F] + d[(p >> 4) & 0x0F] + d[p & 0x0F] + d[(g >> 28) & 0x0F] + d[(g >> 24) & 0x0F] + d[(g >> 20) & 0x0F] + d[(g >> 16) & 0x0F] + d[(g >> 12) & 0x0F] + d[(g >> 8) & 0x0F] + d[(g >> 4) & 0x0F] + d[g & 0x0F] + d[(b >> 28) & 0x0F] + d[(b >> 24) & 0x0F] + d[(b >> 20) & 0x0F] + d[(b >> 16) & 0x0F] + d[(b >> 12) & 0x0F] + d[(b >> 8) & 0x0F] + d[(b >> 4) & 0x0F] + d[b & 0x0F]; } return y; }; E.prototype.toString = E.prototype.hex; E.prototype.digest = function() { this.finalize(); var t = this.h0h, e = this.h0l, r = this.h1h, n = this.h1l, i = this.h2h, o = this.h2l, s = this.h3h, a = this.h3l, f = this.h4h, u = this.h4l, c = this.h5h, l = this.h5l, h = this.h6h, d = this.h6l, p = this.h7h, g = this.h7l, b = this.bits; var v = [ (t >> 24) & 0xFF, (t >> 16) & 0xFF, (t >> 8) & 0xFF, t & 0xFF, (e >> 24) & 0xFF, (e >> 16) & 0xFF, (e >> 8) & 0xFF, e & 0xFF, (r >> 24) & 0xFF, (r >> 16) & 0xFF, (r >> 8) & 0xFF, r & 0xFF, (n >> 24) & 0xFF, (n >> 16) & 0xFF, (n >> 8) & 0xFF, n & 0xFF, (i >> 24) & 0xFF, (i >> 16) & 0xFF, (i >> 8) & 0xFF, i & 0xFF, (o >> 24) & 0xFF, (o >> 16) & 0xFF, (o >> 8) & 0xFF, o & 0xFF, (s >> 24) & 0xFF, (s >> 16) & 0xFF, (s >> 8) & 0xFF, s & 0xFF ]; if (b >= 256) { v.push((a >> 24) & 0xFF, (a >> 16) & 0xFF, (a >> 8) & 0xFF, a & 0xFF); } if (b >= 384) { v.push((f >> 24) & 0xFF, (f >> 16) & 0xFF, (f >> 8) & 0xFF, f & 0xFF, (u >> 24) & 0xFF, (u >> 16) & 0xFF, (u >> 8) & 0xFF, u & 0xFF, (c >> 24) & 0xFF, (c >> 16) & 0xFF, (c >> 8) & 0xFF, c & 0xFF, (l >> 24) & 0xFF, (l >> 16) & 0xFF, (l >> 8) & 0xFF, l & 0xFF); } if (b == 512) { v.push((h >> 24) & 0xFF, (h >> 16) & 0xFF, (h >> 8) & 0xFF, h & 0xFF, (d >> 24) & 0xFF, (d >> 16) & 0xFF, (d >> 8) & 0xFF, d & 0xFF, (p >> 24) & 0xFF, (p >> 16) & 0xFF, (p >> 8) & 0xFF, p & 0xFF, (g >> 24) & 0xFF, (g >> 16) & 0xFF, (g >> 8) & 0xFF, g & 0xFF); } return v; }; E.prototype.array = E.prototype.digest; E.prototype.arrayBuffer = function() { this.finalize(); var t = this.bits; var e = new ArrayBuffer(t / 8); var r = new DataView(e); r.setUint32(0, this.h0h); r.setUint32(4, this.h0l); r.setUint32(8, this.h1h); r.setUint32(12, this.h1l); r.setUint32(16, this.h2h); r.setUint32(20, this.h2l); r.setUint32(24, this.h3h); if (t >= 256) { r.setUint32(28, this.h3l); } if (t >= 384) { r.setUint32(32, this.h4h); r.setUint32(36, this.h4l); r.setUint32(40, this.h5h); r.setUint32(44, this.h5l); } if (t == 512) { r.setUint32(48, this.h6h); r.setUint32(52, this.h6l); r.setUint32(56, this.h7h); r.setUint32(60, this.h7l); } return e; }; E.prototype.clone = function() { var t = new E(this.bits, false); this.copyTo(t); return t; }; E.prototype.copyTo = function(t) { var e = 0, r = [ 'h0h', 'h0l', 'h1h', 'h1l', 'h2h', 'h2l', 'h3h', 'h3l', 'h4h', 'h4l', 'h5h', 'h5l', 'h6h', 'h6l', 'h7h', 'h7l', 'start', 'bytes', 'hBytes', 'finalized', 'hashed', 'lastByteIndex' ]; for(e = 0; e < r.length; ++e){ t[r[e]] = this[r[e]]; } for(e = 0; e < this.blocks.length; ++e){ t.blocks[e] = this.blocks[e]; } }; function x(t, r, n) { var i, o = typeof t; if (o !== 'string') { if (o === 'object') { if (t === null) { throw new Error(e); } else if (h && t.constructor === ArrayBuffer) { t = new Uint8Array(t); } else if (!Array.isArray(t)) { if (!h || !ArrayBuffer.isView(t)) { throw new Error(e); } } } else { throw new Error(e); } i = true; } var s = t.length; if (!i) { var a = [], s = t.length, f = 0, u; for(var c = 0; c < s; ++c){ u = t.charCodeAt(c); if (u < 0x80) { a[f++] = u; } else if (u < 0x800) { a[f++] = (0xc0 | (u >> 6)); a[f++] = (0x80 | (u & 0x3f)); } else if (u < 0xd800 || u >= 0xe000) { a[f++] = (0xe0 | (u >> 12)); a[f++] = (0x80 | ((u >> 6) & 0x3f)); a[f++] = (0x80 | (u & 0x3f)); } else { u = 0x10000 + (((u & 0x3ff) << 10) | (t.charCodeAt(++c) & 0x3ff)); a[f++] = (0xf0 | (u >> 18)); a[f++] = (0x80 | ((u >> 12) & 0x3f)); a[f++] = (0x80 | ((u >> 6) & 0x3f)); a[f++] = (0x80 | (u & 0x3f)); } } t = a; } if (t.length > 128) { t = (new E(r, true)).update(t).array(); } var l = [], d = []; for(var c = 0; c < 128; ++c){ var p = t[c] || 0; l[c] = 0x5c ^ p; d[c] = 0x36 ^ p; } E.call(this, r, n); this.update(d); this.oKeyPad = l; this.inner = true; this.sharedMemory = n; } x.prototype = new E(); x.prototype.finalize = function() { E.prototype.finalize.call(this); if (this.inner) { this.inner = false; var t = this.array(); E.call(this, this.bits, this.sharedMemory); this.update(this.oKeyPad); this.update(t); E.prototype.finalize.call(this); } }; x.prototype.clone = function() { var t = new x([], this.bits, false); this.copyTo(t); t.inner = this.inner; for(var e = 0; e < this.oKeyPad.length; ++e){ t.oKeyPad[e] = this.oKeyPad[e]; } return t; }; var M = w(512); M.sha512 = M; M.sha384 = w(384); M.sha512_256 = w(256); M.sha512_224 = w(224); M.sha512.hmac = S(512); M.sha384.hmac = S(384); M.sha512_256.hmac = S(256); M.sha512_224.hmac = S(224); if (c) { t.exports = M; } else { a.sha512 = M.sha512; a.sha384 = M.sha384; a.sha512_256 = M.sha512_256; a.sha512_224 = M.sha512_224; if (l) { !(i = (function() { return M; }).call(M, r, M, t), i !== undefined && (t.exports = i)); } } })(); }), 5548: (function(t, e, r) { e.unsigned = r(6922); e.signed = r(4927); }), 4927: (function(t, e, r) { const n = r(3550); const i = r(3533); t.exports = { encode: f, decode: u, write: a, read: o, readBn: s }; function o(t) { return s(t).toString(); } function s(t) { const e = new n(0); let r = 0; let i; while(true){ i = t.read(1)[0]; e.ior(new n(i & 0x7f).shln(r)); r += 7; if (i >> 7 === 0) { break; } } if (i & 0x40) { e.setn(r); } return e.fromTwos(r); } function a(t, e) { let r = new n(t); const i = r.isNeg(); if (i) { r = r.toTwos(r.bitLength() + 8); } while(true){ const o = r.maskn(7).toNumber(); r.ishrn(7); if ((s(r) && (o & 0x40) !== 0) || (r.isZero() && (o & 0x40) === 0)) { e.write([ o ]); break; } else { e.write([ o | 0x80 ]); } } function s(t) { return i && t.toString(2).indexOf('0') < 0; } } function f(t) { const e = new i(); a(t, e); return e.buffer; } function u(t) { const e = new i(t); return o(e); } }), 6922: (function(t, e, r) { const n = r(3550); const i = r(3533); t.exports = { encode: f, decode: u, read: o, readBn: s, write: a }; function o(t) { return s(t).toString(); } function s(t) { const e = new n(0); let r = 0; let i; while(true){ i = t.read(1)[0]; e.ior(new n(i & 0x7f).shln(r)); if (i >> 7 === 0) { break; } else { r += 7; } } return e; } function a(t, e) { const r = new n(t); while(true){ const i = r.maskn(7).toNumber(); r.ishrn(7); if (r.isZero()) { e.write([ i ]); break; } else { e.write([ i | 0x80 ]); } } } function f(t) { const e = new i(); a(t, e); return e.buffer; } function u(t) { const e = new i(t); return o(e); } }), 1675: (function(t, e) { "use strict"; e.supports = function t(...e) { const r = e.reduce((t, e)=>Object.assign(t, e), {}); return Object.assign(r, { snapshots: r.snapshots || false, permanence: r.permanence || false, seek: r.seek || false, clear: r.clear || false, getMany: r.getMany || false, keyIterator: r.keyIterator || false, valueIterator: r.valueIterator || false, iteratorNextv: r.iteratorNextv || false, iteratorAll: r.iteratorAll || false, status: r.status || false, createIfMissing: r.createIfMissing || false, errorIfExists: r.errorIfExists || false, deferredOpen: r.deferredOpen || false, promises: r.promises || false, streams: r.streams || false, encodings: Object.assign({}, r.encodings), events: Object.assign({}, r.events), additionalMethods: Object.assign({}, r.additionalMethods) }); }; }), 8499: (function(t, e, r) { "use strict"; const n = r(4473); const i = r(8002); const { Encoding: o } = r(8266); const { BufferFormat: s , ViewFormat: a , UTF8Format: f } = r(2376); const u = Symbol('formats'); const c = Symbol('encodings'); const l = new Set([ 'buffer', 'view', 'utf8' ]); class h { constructor(t){ if (!Array.isArray(t)) { throw new TypeError("The first argument 'formats' must be an array"); } else if (!t.every((t)=>l.has(t))) { throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'"); } this[c] = new Map(); this[u] = new Set(t); for(const e in i){ try { this.encoding(e); } catch (r) { if (r.code !== 'LEVEL_ENCODING_NOT_SUPPORTED') throw r; } } } encodings() { return Array.from(new Set(this[c].values())); } encoding(t) { let e = this[c].get(t); if (e === undefined) { if (typeof t === 'string' && t !== '') { e = b[t]; if (!e) { throw new n(`Encoding '${t}' is not found`, { code: 'LEVEL_ENCODING_NOT_FOUND' }); } } else if (typeof t !== 'object' || t === null) { throw new TypeError("First argument 'encoding' must be a string or object"); } else { e = d(t); } const { name: r , format: i } = e; if (!this[u].has(i)) { if (this[u].has('view')) { e = e.createViewTranscoder(); } else if (this[u].has('buffer')) { e = e.createBufferTranscoder(); } else if (this[u].has('utf8')) { e = e.createUTF8Transcoder(); } else { throw new n(`Encoding '${r}' cannot be transcoded`, { code: 'LEVEL_ENCODING_NOT_SUPPORTED' }); } } for (const o of [ t, r, e.name, e.commonName ]){ this[c].set(o, e); } } return e; } } e.Transcoder = h; function d(t) { if (t instanceof o) { return t; } const e = 'type' in t && typeof t.type === 'string' ? t.type : undefined; const r = t.name || e || `anonymous-${v++}`; switch(p(t)){ case 'view': return new a({ ...t, name: r }); case 'utf8': return new f({ ...t, name: r }); case 'buffer': return new s({ ...t, name: r }); default: { throw new TypeError("Format must be one of 'buffer', 'view', 'utf8'"); } } } function p(t) { if ('format' in t && t.format !== undefined) { return t.format; } else if ('buffer' in t && typeof t.buffer === 'boolean') { return t.buffer ? 'buffer' : 'utf8'; } else if ('code' in t && Number.isInteger(t.code)) { return 'view'; } else { return 'buffer'; } } const g = { binary: i.buffer, 'utf-8': i.utf8 }; const b = { ...i, ...g }; let v = 0; }), 8266: (function(t, e, r) { "use strict"; const n = r(4473); const i = new Set([ 'buffer', 'view', 'utf8' ]); class o { constructor(t){ this.encode = t.encode || this.encode; this.decode = t.decode || this.decode; this.name = t.name || this.name; this.format = t.format || this.format; if (typeof this.encode !== 'function') { throw new TypeError("The 'encode' property must be a function"); } if (typeof this.decode !== 'function') { throw new TypeError("The 'decode' property must be a function"); } this.encode = this.encode.bind(this); this.decode = this.decode.bind(this); if (typeof this.name !== 'string' || this.name === '') { throw new TypeError("The 'name' property must be a string"); } if (typeof this.format !== 'string' || !i.has(this.format)) { throw new TypeError("The 'format' property must be one of 'buffer', 'view', 'utf8'"); } if (t.createViewTranscoder) { this.createViewTranscoder = t.createViewTranscoder; } if (t.createBufferTranscoder) { this.createBufferTranscoder = t.createBufferTranscoder; } if (t.createUTF8Transcoder) { this.createUTF8Transcoder = t.createUTF8Transcoder; } } get commonName() { return (this.name.split('+')[0]); } createBufferTranscoder() { throw new n(`Encoding '${this.name}' cannot be transcoded to 'buffer'`, { code: 'LEVEL_ENCODING_NOT_SUPPORTED' }); } createViewTranscoder() { throw new n(`Encoding '${this.name}' cannot be transcoded to 'view'`, { code: 'LEVEL_ENCODING_NOT_SUPPORTED' }); } createUTF8Transcoder() { throw new n(`Encoding '${this.name}' cannot be transcoded to 'utf8'`, { code: 'LEVEL_ENCODING_NOT_SUPPORTED' }); } } e.Encoding = o; }), 8002: (function(t, e, r) { "use strict"; const { Buffer: n } = r(8764) || { Buffer: { isBuffer: ()=>false } }; const { textEncoder: i , textDecoder: o } = r(5850)(); const { BufferFormat: s , ViewFormat: a , UTF8Format: f } = r(2376); const u = (t)=>t; e.utf8 = new f({ encode: function(t) { return n.isBuffer(t) ? t.toString('utf8') : ArrayBuffer.isView(t) ? o.decode(t) : String(t); }, decode: u, name: 'utf8', createViewTranscoder () { return new a({ encode: function(t) { return ArrayBuffer.isView(t) ? t : i.encode(t); }, decode: function(t) { return o.decode(t); }, name: `${this.name}+view` }); }, createBufferTranscoder () { return new s({ encode: function(t) { return n.isBuffer(t) ? t : ArrayBuffer.isView(t) ? n.from(t.buffer, t.byteOffset, t.byteLength) : n.from(String(t), 'utf8'); }, decode: function(t) { return t.toString('utf8'); }, name: `${this.name}+buffer` }); } }); e.json = new f({ encode: JSON.stringify, decode: JSON.parse, name: 'json' }); e.buffer = new s({ encode: function(t) { return n.isBuffer(t) ? t : ArrayBuffer.isView(t) ? n.from(t.buffer, t.byteOffset, t.byteLength) : n.from(String(t), 'utf8'); }, decode: u, name: 'buffer', createViewTranscoder () { return new a({ encode: function(t) { return ArrayBuffer.isView(t) ? t : n.from(String(t), 'utf8'); }, decode: function(t) { return n.from(t.buffer, t.byteOffset, t.byteLength); }, name: `${this.name}+view` }); } }); e.view = new a({ encode: function(t) { return ArrayBuffer.isView(t) ? t : i.encode(t); }, decode: u, name: 'view', createBufferTranscoder () { return new s({ encode: function(t) { return n.isBuffer(t) ? t : ArrayBuffer.isView(t) ? n.from(t.buffer, t.byteOffset, t.byteLength) : n.from(String(t), 'utf8'); }, decode: u, name: `${this.name}+buffer` }); } }); e.hex = new s({ encode: function(t) { return n.isBuffer(t) ? t : n.from(String(t), 'hex'); }, decode: function(t) { return t.toString('hex'); }, name: 'hex' }); e.base64 = new s({ encode: function(t) { return n.isBuffer(t) ? t : n.from(String(t), 'base64'); }, decode: function(t) { return t.toString('base64'); }, name: 'base64' }); }), 2376: (function(t, e, r) { "use strict"; const { Buffer: n } = r(8764) || {}; const { Encoding: i } = r(8266); const o = r(5850); class s extends i { constructor(t){ super({ ...t, format: 'buffer' }); } createViewTranscoder() { return new a({ encode: this.encode, decode: (t)=>this.decode(n.from(t.buffer, t.byteOffset, t.byteLength)), name: `${this.name}+view` }); } createBufferTranscoder() { return this; } } class a extends i { constructor(t){ super({ ...t, format: 'view' }); } createBufferTranscoder() { return new s({ encode: (t)=>{ const e = this.encode(t); return n.from(e.buffer, e.byteOffset, e.byteLength); }, decode: this.decode, name: `${this.name}+buffer` }); } createViewTranscoder() { return this; } } class f extends i { constructor(t){ super({ ...t, format: 'utf8' }); } createBufferTranscoder() { return new s({ encode: (t)=>n.from(this.encode(t), 'utf8'), decode: (t)=>this.decode(t.toString('utf8')), name: `${this.name}+buffer` }); } createViewTranscoder() { const { textEncoder: t , textDecoder: e } = o(); return new a({ encode: (e)=>t.encode(this.encode(e)), decode: (t)=>this.decode(e.decode(t)), name: `${this.name}+view` }); } createUTF8Transcoder() { return this; } } e.BufferFormat = s; e.ViewFormat = a; e.UTF8Format = f; }), 5850: (function(t) { "use strict"; let e = null; t.exports = function() { if (e === null) { e = { textEncoder: new TextEncoder(), textDecoder: new TextDecoder() }; } return e; }; }), 3145: (function(t, e, r) { e.Level = r(1708).BrowserLevel; }), 8552: (function(t, e, r) { var n = r(852), i = r(5639); var o = n(i, 'DataView'); t.exports = o; }), 1989: (function(t, e, r) { var n = r(1789), i = r(401), o = r(7667), s = r(1327), a = r(1866); function f(t) { var e = -1, r = t == null ? 0 : t.length; this.clear(); while(++e < r){ var n = t[e]; this.set(n[0], n[1]); } } f.prototype.clear = n; f.prototype['delete'] = i; f.prototype.get = o; f.prototype.has = s; f.prototype.set = a; t.exports = f; }), 8407: (function(t, e, r) { var n = r(7040), i = r(4125), o = r(2117), s = r(7518), a = r(4705); function f(t) { var e = -1, r = t == null ? 0 : t.length; this.clear(); while(++e < r){ var n = t[e]; this.set(n[0], n[1]); } } f.prototype.clear = n; f.prototype['delete'] = i; f.prototype.get = o; f.prototype.has = s; f.prototype.set = a; t.exports = f; }), 7071: (function(t, e, r) { var n = r(852), i = r(5639); var o = n(i, 'Map'); t.exports = o; }), 3369: (function(t, e, r) { var n = r(4785), i = r(1285), o = r(6000), s = r(9916), a = r(5265); function f(t) { var e = -1, r = t == null ? 0 : t.length; this.clear(); while(++e < r){ var n = t[e]; this.set(n[0], n[1]); } } f.prototype.clear = n; f.prototype['delete'] = i; f.prototype.get = o; f.prototype.has = s; f.prototype.set = a; t.exports = f; }), 3818: (function(t, e, r) { var n = r(852), i = r(5639); var o = n(i, 'Promise'); t.exports = o; }), 8525: (function(t, e, r) { var n = r(852), i = r(5639); var o = n(i, 'Set'); t.exports = o; }), 6384: (function(t, e, r) { var n = r(8407), i = r(7465), o = r(3779), s = r(7599), a = r(4758), f = r(4309); function u(t) { var e = this.__data__ = new n(t); this.size = e.size; } u.prototype.clear = i; u.prototype['delete'] = o; u.prototype.get = s; u.prototype.has = a; u.prototype.set = f; t.exports = u; }), 2705: (function(t, e, r) { var n = r(5639); var i = n.Symbol; t.exports = i; }), 1149: (function(t, e, r) { var n = r(5639); var i = n.Uint8Array; t.exports = i; }), 577: (function(t, e, r) { var n = r(852), i = r(5639); var o = n(i, 'WeakMap'); t.exports = o; }), 7412: (function(t) { function e(t, e) { var r = -1, n = t == null ? 0 : t.length; while(++r < n){ if (e(t[r], r, t) === false) { break; } } return t; } t.exports = e; }), 4963: (function(t) { function e(t, e) { var r = -1, n = t == null ? 0 : t.length, i = 0, o = []; while(++r < n){ var s = t[r]; if (e(s, r, t)) { o[i++] = s; } } return o; } t.exports = e; }), 4636: (function(t, e, r) { var n = r(2545), i = r(5694), o = r(1469), s = r(4144), a = r(213), f = r(6719); var u = Object.prototype; var c = u.hasOwnProperty; function l(t, e) { var r = o(t), u = !r && i(t), l = !r && !u && s(t), h = !r && !u && !l && f(t), d = r || u || l || h, p = d ? n(t.length, String) : [], g = p.length; for(var b in t){ if ((e || c.call(t, b)) && !(d && (b == 'length' || (l && (b == 'offset' || b == 'parent')) || (h && (b == 'buffer' || b == 'byteLength' || b == 'byteOffset')) || a(b, g)))) { p.push(b); } } return p; } t.exports = l; }), 2488: (function(t) { function e(t, e) { var r = -1, n = e.length, i = t.length; while(++r < n){ t[i + r] = e[r]; } return t; } t.exports = e; }), 4865: (function(t, e, r) { var n = r(9465), i = r(7813); var o = Object.prototype; var s = o.hasOwnProperty; function a(t, e, r) { var o = t[e]; if (!(s.call(t, e) && i(o, r)) || (r === undefined && !(e in t))) { n(t, e, r); } } t.exports = a; }), 8470: (function(t, e, r) { var n = r(7813); function i(t, e) { var r = t.length; while(r--){ if (n(t[r][0], e)) { return r; } } return -1; } t.exports = i; }), 4037: (function(t, e, r) { var n = r(8363), i = r(3674); function o(t, e) { return t && n(e, i(e), t); } t.exports = o; }), 3886: (function(t, e, r) { var n = r(8363), i = r(1704); function o(t, e) { return t && n(e, i(e), t); } t.exports = o; }), 9465: (function(t, e, r) { var n = r(8777); function i(t, e, r) { if (e == '__proto__' && n) { n(t, e, { 'configurable': true, 'enumerable': true, 'value': r, 'writable': true }); } else { t[e] = r; } } t.exports = i; }), 5990: (function(t, e, r) { var n = r(6384), i = r(7412), o = r(4865), s = r(4037), a = r(3886), f = r(4626), u = r(278), c = r(8805), l = r(1911), h = r(8234), d = r(6904), p = r(4160), g = r(3824), b = r(9148), v = r(8517), y = r(1469), m = r(4144), w = r(6688), _ = r(3218), S = r(2928), E = r(3674), x = r(1704); var M = 1, T = 2, A = 4; var O = '[object Arguments]', k = '[object Array]', I = '[object Boolean]', R = '[object Date]', N = '[object Error]', j = '[object Function]', P = '[object GeneratorFunction]', C = '[object Map]', B = '[object Number]', L = '[object Object]', U = '[object RegExp]', D = '[object Set]', $ = '[object String]', F = '[object Symbol]', W = '[object WeakMap]'; var q = '[object ArrayBuffer]', z = '[object DataView]', G = '[object Float32Array]', K = '[object Float64Array]', V = '[object Int8Array]', H = '[object Int16Array]', J = '[object Int32Array]', X = '[object Uint8Array]', Y = '[object Uint8ClampedArray]', Z = '[object Uint16Array]', Q = '[object Uint32Array]'; var tt = {}; tt[O] = tt[k] = tt[q] = tt[z] = tt[I] = tt[R] = tt[G] = tt[K] = tt[V] = tt[H] = tt[J] = tt[C] = tt[B] = tt[L] = tt[U] = tt[D] = tt[$] = tt[F] = tt[X] = tt[Y] = tt[Z] = tt[Q] = true; tt[N] = tt[j] = tt[W] = false; function te(t, e, r, k, I, R) { var N, C = e & M, B = e & T, U = e & A; if (r) { N = I ? r(t, k, I, R) : r(t); } if (N !== undefined) { return N; } if (!_(t)) { return t; } var D = y(t); if (D) { N = g(t); if (!C) { return u(t, N); } } else { var $ = p(t), F = $ == j || $ == P; if (m(t)) { return f(t, C); } if ($ == L || $ == O || (F && !I)) { N = (B || F) ? {} : v(t); if (!C) { return B ? l(t, a(N, t)) : c(t, s(N, t)); } } else { if (!tt[$]) { return I ? t : {}; } N = b(t, $, C); } } R || (R = new n); var W = R.get(t); if (W) { return W; } R.set(t, N); if (S(t)) { t.forEach(function(n) { N.add(te(n, e, r, n, t, R)); }); } else if (w(t)) { t.forEach(function(n, i) { N.set(i, te(n, e, r, i, t, R)); }); } var q = U ? (B ? d : h) : (B ? x : E); var z = D ? undefined : q(t); i(z || t, function(n, i) { if (z) { i = n; n = t[i]; } o(N, i, te(n, e, r, i, t, R)); }); return N; } t.exports = te; }), 3118: (function(t, e, r) { var n = r(3218); var i = Object.create; var o = (function() { function t() {} return function(e) { if (!n(e)) { return {}; } if (i) { return i(e); } t.prototype = e; var r = new t; t.prototype = undefined; return r; }; }()); t.exports = o; }), 8866: (function(t, e, r) { var n = r(2488), i = r(1469); function o(t, e, r) { var o = e(t); return i(t) ? o : n(o, r(t)); } t.exports = o; }), 4239: (function(t, e, r) { var n = r(2705), i = r(9607), o = r(2333); var s = '[object Null]', a = '[object Undefined]'; var f = n ? n.toStringTag : undefined; function u(t) { if (t == null) { return t === undefined ? a : s; } return (f && f in Object(t)) ? i(t) : o(t); } t.exports = u; }), 9454: (function(t, e, r) { var n = r(4239), i = r(7005); var o = '[object Arguments]'; function s(t) { return i(t) && n(t) == o; } t.exports = s; }), 5588: (function(t, e, r) { var n = r(4160), i = r(7005); var o = '[object Map]'; function s(t) { return i(t) && n(t) == o; } t.exports = s; }), 8458: (function(t, e, r) { var n = r(3560), i = r(5346), o = r(3218), s = r(346); var a = /[\\^$.*+?()[\]{}|]/g; var f = /^\[object .+?Constructor\]$/; var u = Function.prototype, c = Object.prototype; var l = u.toString; var h = c.hasOwnProperty; var d = RegExp('^' + l.call(h).replace(a, '\\$&').replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g, '$1.*?') + '$'); function p(t) { if (!o(t) || i(t)) { return false; } var e = n(t) ? d : f; return e.test(s(t)); } t.exports = p; }), 9221: (function(t, e, r) { var n = r(4160), i = r(7005); var o = '[object Set]'; function s(t) { return i(t) && n(t) == o; } t.exports = s; }), 8749: (function(t, e, r) { var n = r(4239), i = r(1780), o = r(7005); var s = '[object Arguments]', a = '[object Array]', f = '[object Boolean]', u = '[object Date]', c = '[object Error]', l = '[object Function]', h = '[object Map]', d = '[object Number]', p = '[object Object]', g = '[object RegExp]', b = '[object Set]', v = '[object String]', y = '[object WeakMap]'; var m = '[object ArrayBuffer]', w = '[object DataView]', _ = '[object Float32Array]', S = '[object Float64Array]', E = '[object Int8Array]', x = '[object Int16Array]', M = '[object Int32Array]', T = '[object Uint8Array]', A = '[object Uint8ClampedArray]', O = '[object Uint16Array]', k = '[object Uint32Array]'; var I = {}; I[_] = I[S] = I[E] = I[x] = I[M] = I[T] = I[A] = I[O] = I[k] = true; I[s] = I[a] = I[m] = I[f] = I[w] = I[u] = I[c] = I[l] = I[h] = I[d] = I[p] = I[g] = I[b] = I[v] = I[y] = false; function R(t) { return o(t) && i(t.length) && !!I[n(t)]; } t.exports = R; }), 280: (function(t, e, r) { var n = r(5726), i = r(6916); var o = Object.prototype; var s = o.hasOwnProperty; function a(t) { if (!n(t)) { return i(t); } var e = []; for(var r in Object(t)){ if (s.call(t, r) && r != 'constructor') { e.push(r); } } return e; } t.exports = a; }), 313: (function(t, e, r) { var n = r(3218), i = r(5726), o = r(3498); var s = Object.prototype; var a = s.hasOwnProperty; function f(t) { if (!n(t)) { return o(t); } var e = i(t), r = []; for(var s in t){ if (!(s == 'constructor' && (e || !a.call(t, s)))) { r.push(s); } } return r; } t.exports = f; }), 2545: (function(t) { function e(t, e) { var r = -1, n = Array(t); while(++r < t){ n[r] = e(r); } return n; } t.exports = e; }), 1717: (function(t) { function e(t) { return function(e) { return t(e); }; } t.exports = e; }), 4318: (function(t, e, r) { var n = r(1149); function i(t) { var e = new t.constructor(t.byteLength); new n(e).set(new n(t)); return e; } t.exports = i; }), 4626: (function(t, e, r) { t = r.nmd(t); var n = r(5639); var i = true && e && !e.nodeType && e; var o = i && "object" == 'object' && t && !t.nodeType && t; var s = o && o.exports === i; var a = s ? n.Buffer : undefined, f = a ? a.allocUnsafe : undefined; function u(t, e) { if (e) { return t.slice(); } var r = t.length, n = f ? f(r) : new t.constructor(r); t.copy(n); return n; } t.exports = u; }), 7157: (function(t, e, r) { var n = r(4318); function i(t, e) { var r = e ? n(t.buffer) : t.buffer; return new t.constructor(r, t.byteOffset, t.byteLength); } t.exports = i; }), 3147: (function(t) { var e = /\w*$/; function r(t) { var r = new t.constructor(t.source, e.exec(t)); r.lastIndex = t.lastIndex; return r; } t.exports = r; }), 419: (function(t, e, r) { var n = r(2705); var i = n ? n.prototype : undefined, o = i ? i.valueOf : undefined; function s(t) { return o ? Object(o.call(t)) : {}; } t.exports = s; }), 7133: (function(t, e, r) { var n = r(4318); function i(t, e) { var r = e ? n(t.buffer) : t.buffer; return new t.constructor(r, t.byteOffset, t.length); } t.exports = i; }), 278: (function(t) { function e(t, e) { var r = -1, n = t.length; e || (e = Array(n)); while(++r < n){ e[r] = t[r]; } return e; } t.exports = e; }), 8363: (function(t, e, r) { var n = r(4865), i = r(9465); function o(t, e, r, o) { var s = !r; r || (r = {}); var a = -1, f = e.length; while(++a < f){ var u = e[a]; var c = o ? o(r[u], t[u], u, r, t) : undefined; if (c === undefined) { c = t[u]; } if (s) { i(r, u, c); } else { n(r, u, c); } } return r; } t.exports = o; }), 8805: (function(t, e, r) { var n = r(8363), i = r(9551); function o(t, e) { return n(t, i(t), e); } t.exports = o; }), 1911: (function(t, e, r) { var n = r(8363), i = r(1442); function o(t, e) { return n(t, i(t), e); } t.exports = o; }), 4429: (function(t, e, r) { var n = r(5639); var i = n['__core-js_shared__']; t.exports = i; }), 8777: (function(t, e, r) { var n = r(852); var i = (function() { try { var t = n(Object, 'defineProperty'); t({}, '', {}); return t; } catch (e) {} }()); t.exports = i; }), 1957: (function(t, e, r) { var n = typeof r.g == 'object' && r.g && r.g.Object === Object && r.g; t.exports = n; }), 8234: (function(t, e, r) { var n = r(8866), i = r(9551), o = r(3674); function s(t) { return n(t, o, i); } t.exports = s; }), 6904: (function(t, e, r) { var n = r(8866), i = r(1442), o = r(1704); function s(t) { return n(t, o, i); } t.exports = s; }), 5050: (function(t, e, r) { var n = r(7019); function i(t, e) { var r = t.__data__; return n(e) ? r[typeof e == 'string' ? 'string' : 'hash'] : r.map; } t.exports = i; }), 852: (function(t, e, r) { var n = r(8458), i = r(7801); function o(t, e) { var r = i(t, e); return n(r) ? r : undefined; } t.exports = o; }), 5924: (function(t, e, r) { var n = r(5569); var i = n(Object.getPrototypeOf, Object); t.exports = i; }), 9607: (function(t, e, r) { var n = r(2705); var i = Object.prototype; var o = i.hasOwnProperty; var s = i.toString; var a = n ? n.toStringTag : undefined; function f(t) { var e = o.call(t, a), r = t[a]; try { t[a] = undefined; var n = true; } catch (i) {} var f = s.call(t); if (n) { if (e) { t[a] = r; } else { delete t[a]; } } return f; } t.exports = f; }), 9551: (function(t, e, r) { var n = r(4963), i = r(479); var o = Object.prototype; var s = o.propertyIsEnumerable; var a = Object.getOwnPropertySymbols; var f = !a ? i : function(t) { if (t == null) { return []; } t = Object(t); return n(a(t), function(e) { return s.call(t, e); }); }; t.exports = f; }), 1442: (function(t, e, r) { var n = r(2488), i = r(5924), o = r(9551), s = r(479); var a = Object.getOwnPropertySymbols; var f = !a ? s : function(t) { var e = []; while(t){ n(e, o(t)); t = i(t); } return e; }; t.exports = f; }), 4160: (function(t, e, r) { var n = r(8552), i = r(7071), o = r(3818), s = r(8525), a = r(577), f = r(4239), u = r(346); var c = '[object Map]', l = '[object Object]', h = '[object Promise]', d = '[object Set]', p = '[object WeakMap]'; var g = '[object DataView]'; var b = u(n), v = u(i), y = u(o), m = u(s), w = u(a); var _ = f; if ((n && _(new n(new ArrayBuffer(1))) != g) || (i && _(new i) != c) || (o && _(o.resolve()) != h) || (s && _(new s) != d) || (a && _(new a) != p)) { _ = function(t) { var e = f(t), r = e == l ? t.constructor : undefined, n = r ? u(r) : ''; if (n) { switch(n){ case b: return g; case v: return c; case y: return h; case m: return d; case w: return p; } } return e; }; } t.exports = _; }), 7801: (function(t) { function e(t, e) { return t == null ? undefined : t[e]; } t.exports = e; }), 1789: (function(t, e, r) { var n = r(4536); function i() { this.__data__ = n ? n(null) : {}; this.size = 0; } t.exports = i; }), 401: (function(t) { function e(t) { var e = this.has(t) && delete this.__data__[t]; this.size -= e ? 1 : 0; return e; } t.exports = e; }), 7667: (function(t, e, r) { var n = r(4536); var i = '__lodash_hash_undefined__'; var o = Object.prototype; var s = o.hasOwnProperty; function a(t) { var e = this.__data__; if (n) { var r = e[t]; return r === i ? undefined : r; } return s.call(e, t) ? e[t] : undefined; } t.exports = a; }), 1327: (function(t, e, r) { var n = r(4536); var i = Object.prototype; var o = i.hasOwnProperty; function s(t) { var e = this.__data__; return n ? (e[t] !== undefined) : o.call(e, t); } t.exports = s; }), 1866: (function(t, e, r) { var n = r(4536); var i = '__lodash_hash_undefined__'; function o(t, e) { var r = this.__data__; this.size += this.has(t) ? 0 : 1; r[t] = (n && e === undefined) ? i : e; return this; } t.exports = o; }), 3824: (function(t) { var e = Object.prototype; var r = e.hasOwnProperty; function n(t) { var e = t.length, n = new t.constructor(e); if (e && typeof t[0] == 'string' && r.call(t, 'index')) { n.index = t.index; n.input = t.input; } return n; } t.exports = n; }), 9148: (function(t, e, r) { var n = r(4318), i = r(7157), o = r(3147), s = r(419), a = r(7133); var f = '[object Boolean]', u = '[object Date]', c = '[object Map]', l = '[object Number]', h = '[object RegExp]', d = '[object Set]', p = '[object String]', g = '[object Symbol]'; var b = '[object ArrayBuffer]', v = '[object DataView]', y = '[object Float32Array]', m = '[object Float64Array]', w = '[object Int8Array]', _ = '[object Int16Array]', S = '[object Int32Array]', E = '[object Uint8Array]', x = '[object Uint8ClampedArray]', M = '[object Uint16Array]', T = '[object Uint32Array]'; function A(t, e, r) { var A = t.constructor; switch(e){ case b: return n(t); case f: case u: return new A(+t); case v: return i(t, r); case y: case m: case w: case _: case S: case E: case x: case M: case T: return a(t, r); case c: return new A; case l: case p: return new A(t); case h: return o(t); case d: return new A; case g: return s(t); } } t.exports = A; }), 8517: (function(t, e, r) { var n = r(3118), i = r(5924), o = r(5726); function s(t) { return (typeof t.constructor == 'function' && !o(t)) ? n(i(t)) : {}; } t.exports = s; }), 213: (function(t) { var e = 9007199254740991; var r = /^(?:0|[1-9]\d*)$/; function n(t, n) { var i = typeof t; n = n == null ? e : n; return !!n && (i == 'number' || (i != 'symbol' && r.test(t))) && (t > -1 && t % 1 == 0 && t < n); } t.exports = n; }), 7019: (function(t) { function e(t) { var e = typeof t; return (e == 'string' || e == 'number' || e == 'symbol' || e == 'boolean') ? (t !== '__proto__') : (t === null); } t.exports = e; }), 5346: (function(t, e, r) { var n = r(4429); var i = (function() { var t = /[^.]+$/.exec(n && n.keys && n.keys.IE_PROTO || ''); return t ? ('Symbol(src)_1.' + t) : ''; }()); function o(t) { return !!i && (i in t); } t.exports = o; }), 5726: (function(t) { var e = Object.prototype; function r(t) { var r = t && t.constructor, n = (typeof r == 'function' && r.prototype) || e; return t === n; } t.exports = r; }), 7040: (function(t) { function e() { this.__data__ = []; this.size = 0; } t.exports = e; }), 4125: (function(t, e, r) { var n = r(8470); var i = Array.prototype; var o = i.splice; function s(t) { var e = this.__data__, r = n(e, t); if (r < 0) { return false; } var i = e.length - 1; if (r == i) { e.pop(); } else { o.call(e, r, 1); } --this.size; return true; } t.exports = s; }), 2117: (function(t, e, r) { var n = r(8470); function i(t) { var e = this.__data__, r = n(e, t); return r < 0 ? undefined : e[r][1]; } t.exports = i; }), 7518: (function(t, e, r) { var n = r(8470); function i(t) { return n(this.__data__, t) > -1; } t.exports = i; }), 4705: (function(t, e, r) { var n = r(8470); function i(t, e) { var r = this.__data__, i = n(r, t); if (i < 0) { ++this.size; r.push([ t, e ]); } else { r[i][1] = e; } return this; } t.exports = i; }), 4785: (function(t, e, r) { var n = r(1989), i = r(8407), o = r(7071); function s() { this.size = 0; this.__data__ = { 'hash': new n, 'map': new (o || i), 'string': new n }; } t.exports = s; }), 1285: (function(t, e, r) { var n = r(5050); function i(t) { var e = n(this, t)['delete'](t); this.size -= e ? 1 : 0; return e; } t.exports = i; }), 6000: (function(t, e, r) { var n = r(5050); function i(t) { return n(this, t).get(t); } t.exports = i; }), 9916: (function(t, e, r) { var n = r(5050); function i(t) { return n(this, t).has(t); } t.exports = i; }), 5265: (function(t, e, r) { var n = r(5050); function i(t, e) { var r = n(this, t), i = r.size; r.set(t, e); this.size += r.size == i ? 0 : 1; return this; } t.exports = i; }), 4536: (function(t, e, r) { var n = r(852); var i = n(Object, 'create'); t.exports = i; }), 6916: (function(t, e, r) { var n = r(5569); var i = n(Object.keys, Object); t.exports = i; }), 3498: (function(t) { function e(t) { var e = []; if (t != null) { for(var r in Object(t)){ e.push(r); } } return e; } t.exports = e; }), 1167: (function(t, e, r) { t = r.nmd(t); var n = r(1957); var i = true && e && !e.nodeType && e; var o = i && "object" == 'object' && t && !t.nodeType && t; var s = o && o.exports === i; var a = s && n.process; var f = (function() { try { var t = o && o.require && o.require('util').types; if (t) { return t; } return a && a.binding && a.binding('util'); } catch (e) {} }()); t.exports = f; }), 2333: (function(t) { var e = Object.prototype; var r = e.toString; function n(t) { return r.call(t); } t.exports = n; }), 5569: (function(t) { function e(t, e) { return function(r) { return t(e(r)); }; } t.exports = e; }), 5639: (function(t, e, r) { var n = r(1957); var i = typeof self == 'object' && self && self.Object === Object && self; var o = n || i || Function('return this')(); t.exports = o; }), 7465: (function(t, e, r) { var n = r(8407); function i() { this.__data__ = new n; this.size = 0; } t.exports = i; }), 3779: (function(t) { function e(t) { var e = this.__data__, r = e['delete'](t); this.size = e.size; return r; } t.exports = e; }), 7599: (function(t) { function e(t) { return this.__data__.get(t); } t.exports = e; }), 4758: (function(t) { function e(t) { return this.__data__.has(t); } t.exports = e; }), 4309: (function(t, e, r) { var n = r(8407), i = r(7071), o = r(3369); var s = 200; function a(t, e) { var r = this.__data__; if (r instanceof n) { var a = r.__data__; if (!i || (a.length < s - 1)) { a.push([ t, e ]); this.size = ++r.size; return this; } r = this.__data__ = new o(a); } r.set(t, e); this.size = r.size; return this; } t.exports = a; }), 346: (function(t) { var e = Function.prototype; var r = e.toString; function n(t) { if (t != null) { try { return r.call(t); } catch (e) {} try { return (t + ''); } catch (n) {} } return ''; } t.exports = n; }), 361: (function(t, e, r) { var n = r(5990); var i = 1, o = 4; function s(t) { return n(t, i | o); } t.exports = s; }), 7813: (function(t) { function e(t, e) { return t === e || (t !== t && e !== e); } t.exports = e; }), 5694: (function(t, e, r) { var n = r(9454), i = r(7005); var o = Object.prototype; var s = o.hasOwnProperty; var a = o.propertyIsEnumerable; var f = n(function() { return arguments; }()) ? n : function(t) { return i(t) && s.call(t, 'callee') && !a.call(t, 'callee'); }; t.exports = f; }), 1469: (function(t) { var e = Array.isArray; t.exports = e; }), 1240: (function(t, e, r) { var n = r(3560), i = r(1780); function o(t) { return t != null && i(t.length) && !n(t); } t.exports = o; }), 4144: (function(t, e, r) { t = r.nmd(t); var n = r(5639), i = r(5062); var o = true && e && !e.nodeType && e; var s = o && "object" == 'object' && t && !t.nodeType && t; var a = s && s.exports === o; var f = a ? n.Buffer : undefined; var u = f ? f.isBuffer : undefined; var c = u || i; t.exports = c; }), 3560: (function(t, e, r) { var n = r(4239), i = r(3218); var o = '[object AsyncFunction]', s = '[object Function]', a = '[object GeneratorFunction]', f = '[object Proxy]'; function u(t) { if (!i(t)) { return false; } var e = n(t); return e == s || e == a || e == o || e == f; } t.exports = u; }), 1780: (function(t) { var e = 9007199254740991; function r(t) { return typeof t == 'number' && t > -1 && t % 1 == 0 && t <= e; } t.exports = r; }), 6688: (function(t, e, r) { var n = r(5588), i = r(1717), o = r(1167); var s = o && o.isMap; var a = s ? i(s) : n; t.exports = a; }), 3218: (function(t) { function e(t) { var e = typeof t; return t != null && (e == 'object' || e == 'function'); } t.exports = e; }), 7005: (function(t) { function e(t) { return t != null && typeof t == 'object'; } t.exports = e; }), 2928: (function(t, e, r) { var n = r(9221), i = r(1717), o = r(1167); var s = o && o.isSet; var a = s ? i(s) : n; t.exports = a; }), 6719: (function(t, e, r) { var n = r(8749), i = r(1717), o = r(1167); var s = o && o.isTypedArray; var a = s ? i(s) : n; t.exports = a; }), 3674: (function(t, e, r) { var n = r(4636), i = r(280), o = r(1240); function s(t) { return o(t) ? n(t) : i(t); } t.exports = s; }), 1704: (function(t, e, r) { var n = r(4636), i = r(313), o = r(1240); function s(t) { return o(t) ? n(t, true) : i(t); } t.exports = s; }), 479: (function(t) { function e() { return []; } t.exports = e; }), 5062: (function(t) { function e() { return false; } t.exports = e; }), 1271: (function(t, e, r) { "use strict"; var n = r(3454); const { AbstractLevel: i , AbstractIterator: o , AbstractKeyIterator: s , AbstractValueIterator: a } = r(875); const f = r(4473); const u = r(4977); const c = new Set([ 'gt', 'gte', 'lt', 'lte' ]); const l = Symbol('none'); const h = Symbol('tree'); const d = Symbol('iterator'); const p = Symbol('lowerBound'); const g = Symbol('upperBound'); const b = Symbol('outOfRange'); const v = Symbol('reverse'); const y = Symbol('options'); const m = Symbol('test'); const w = Symbol('advance'); const _ = Symbol('init'); function S(t, e) { if (typeof t === 'string') { return t < e ? -1 : t > e ? 1 : 0; } const r = Math.min(t.byteLength, e.byteLength); for(let n = 0; n < r; n++){ const i = t[n] - e[n]; if (i !== 0) return i; } return t.byteLength - e.byteLength; } function E(t) { return S(t, this[g]) > 0; } function x(t) { return S(t, this[g]) >= 0; } function M(t) { return S(t, this[g]) < 0; } function T(t) { return S(t, this[g]) <= 0; } class A extends o { constructor(t, e){ super(t, e); this[_](t[h], e); } _next(t) { if (!this[d].valid) return this.nextTick(t); const e = this[d].key; const r = this[d].value; if (!this[m](e)) return this.nextTick(t); this[d][this[w]](); this.nextTick(t, null, e, r); } _nextv(t, e, r) { const n = this[d]; const i = []; while(n.valid && i.length < t && this[m](n.key)){ i.push([ n.key, n.value ]); n[this[w]](); } this.nextTick(r, null, i); } _all(t, e) { const r = this.limit - this.count; const n = this[d]; const i = []; while(n.valid && i.length < r && this[m](n.key)){ i.push([ n.key, n.value ]); n[this[w]](); } this.nextTick(e, null, i); } } class O extends s { constructor(t, e){ super(t, e); this[_](t[h], e); } _next(t) { if (!this[d].valid) return this.nextTick(t); const e = this[d].key; if (!this[m](e)) return this.nextTick(t); this[d][this[w]](); this.nextTick(t, null, e); } _nextv(t, e, r) { const n = this[d]; const i = []; while(n.valid && i.length < t && this[m](n.key)){ i.push(n.key); n[this[w]](); } this.nextTick(r, null, i); } _all(t, e) { const r = this.limit - this.count; const n = this[d]; const i = []; while(n.valid && i.length < r && this[m](n.key)){ i.push(n.key); n[this[w]](); } this.nextTick(e, null, i); } } class k extends a { constructor(t, e){ super(t, e); this[_](t[h], e); } _next(t) { if (!this[d].valid) return this.nextTick(t); const e = this[d].key; const r = this[d].value; if (!this[m](e)) return this.nextTick(t); this[d][this[w]](); this.nextTick(t, null, r); } _nextv(t, e, r) { const n = this[d]; const i = []; while(n.valid && i.length < t && this[m](n.key)){ i.push(n.value); n[this[w]](); } this.nextTick(r, null, i); } _all(t, e) { const r = this.limit - this.count; const n = this[d]; const i = []; while(n.valid && i.length < r && this[m](n.key)){ i.push(n.value); n[this[w]](); } this.nextTick(e, null, i); } } for (const I of [ A, O, k ]){ I.prototype[_] = function(t, e) { this[v] = e.reverse; this[y] = e; if (!this[v]) { this[w] = 'next'; this[p] = 'gte' in e ? e.gte : 'gt' in e ? e.gt : l; this[g] = 'lte' in e ? e.lte : 'lt' in e ? e.lt : l; if (this[p] === l) { this[d] = t.begin; } else if ('gte' in e) { this[d] = t.ge(this[p]); } else { this[d] = t.gt(this[p]); } if (this[g] !== l) { this[m] = 'lte' in e ? T : M; } } else { this[w] = 'prev'; this[p] = 'lte' in e ? e.lte : 'lt' in e ? e.lt : l; this[g] = 'gte' in e ? e.gte : 'gt' in e ? e.gt : l; if (this[p] === l) { this[d] = t.end; } else if ('lte' in e) { this[d] = t.le(this[p]); } else { this[d] = t.lt(this[p]); } if (this[g] !== l) { this[m] = 'gte' in e ? x : E; } } }; I.prototype[m] = function() { return true; }; I.prototype[b] = function(t) { if (!this[m](t)) { return true; } else if (this[p] === l) { return false; } else if (!this[v]) { if ('gte' in this[y]) { return S(t, this[p]) < 0; } else { return S(t, this[p]) <= 0; } } else { if ('lte' in this[y]) { return S(t, this[p]) > 0; } else { return S(t, this[p]) >= 0; } } }; I.prototype._seek = function(t, e) { if (this[b](t)) { this[d] = this[d].tree.end; this[d].next(); } else if (this[v]) { this[d] = this[d].tree.le(t); } else { this[d] = this[d].tree.ge(t); } }; } class R extends i { constructor(t, e, r){ if (typeof t === 'object' && t !== null) { e = t; } if (typeof t === 'function' || typeof e === 'function' || typeof r === 'function') { throw new f('The levelup-style callback argument has been removed', { code: 'LEVEL_LEGACY' }); } let { storeEncoding: n , ...i } = e || {}; n = n || 'buffer'; if (![ 'buffer', 'view', 'utf8' ].includes(n)) { throw new f("The storeEncoding option must be 'buffer', 'view' or 'utf8'", { code: 'LEVEL_ENCODING_NOT_SUPPORTED' }); } super({ seek: true, permanence: false, createIfMissing: false, errorIfExists: false, encodings: { [n]: true } }, i); this[h] = u(S); } _put(t, e, r, n) { const i = this[h].find(t); if (i.valid) { this[h] = i.update(e); } else { this[h] = this[h].insert(t, e); } this.nextTick(n); } _get(t, e, r) { const n = this[h].get(t); if (typeof n === 'undefined') { return this.nextTick(r, new Error('NotFound')); } this.nextTick(r, null, n); } _getMany(t, e, r) { this.nextTick(r, null, t.map((t)=>this[h].get(t))); } _del(t, e, r) { this[h] = this[h].remove(t); this.nextTick(r); } _batch(t, e, r) { let n = this[h]; for (const i of t){ const o = i.key; const s = n.find(o); if (i.type === 'put') { n = s.valid ? s.update(i.value) : n.insert(o, i.value); } else { n = s.remove(); } } this[h] = n; this.nextTick(r); } _clear(t, e) { if (t.limit === -1 && !Object.keys(t).some(N)) { this[h] = u(S); return this.nextTick(e); } const r = this._keys({ ...t }); const n = r.limit; let i = 0; const o = ()=>{ for(let t = 0; t < 500; t++){ if (++i > n) return e(); if (!r[d].valid) return e(); if (!r[m](r[d].key)) return e(); this[h] = this[h].remove(r[d].key); r[d][r[w]](); } this.nextTick(o); }; this.nextTick(o); } _iterator(t) { return new A(this, t); } _keys(t) { return new O(this, t); } _values(t) { return new k(this, t); } } e.MemoryLevel = R; if (typeof n !== 'undefined' && !true && 0 && 0) {} function N(t) { return c.has(t); } }), 9746: (function(t) { t.exports = e; function e(t, e) { if (!t) throw new Error(e || 'Assertion failed'); } e.equal = function t(e, r, n) { if (e != r) throw new Error(n || ('Assertion failed: ' + e + ' != ' + r)); }; }), 4504: (function(t, e) { "use strict"; var r = e; function n(t, e) { if (Array.isArray(t)) return t.slice(); if (!t) return []; var r = []; if (typeof t !== 'string') { for(var n = 0; n < t.length; n++)r[n] = t[n] | 0; return r; } if (e === 'hex') { t = t.replace(/[^a-z0-9]+/ig, ''); if (t.length % 2 !== 0) t = '0' + t; for(var n = 0; n < t.length; n += 2)r.push(parseInt(t[n] + t[n + 1], 16)); } else { for(var n = 0; n < t.length; n++){ var i = t.charCodeAt(n); var o = i >> 8; var s = i & 0xff; if (o) r.push(o, s); else r.push(s); } } return r; } r.toArray = n; function i(t) { if (t.length === 1) return '0' + t; else return t; } r.zero2 = i; function o(t) { var e = ''; for(var r = 0; r < t.length; r++)e += i(t[r].toString(16)); return e; } r.toHex = o; r.encode = function t(e, r) { if (r === 'hex') return o(e); else return e; }; }), 4473: (function(t) { "use strict"; t.exports = class t extends Error { constructor(t, e){ super(t || ''); if (typeof e === 'object' && e !== null) { if (e.code) this.code = String(e.code); if (e.expected) this.expected = true; if (e.transient) this.transient = true; if (e.cause) this.cause = e.cause; } if (Error.captureStackTrace) { Error.captureStackTrace(this, this.constructor); } } }; }), 3454: (function(t, e, r) { "use strict"; var n, i; t.exports = ((n = r.g.process) == null ? void 0 : n.env) && typeof ((i = r.g.process) == null ? void 0 : i.env) === "object" ? r.g.process : r(7663); }), 7663: (function(t) { var e = "/"; (function() { var r = { 308: function(t) { var e = t.exports = {}; var r; var n; function i() { throw new Error("setTimeout has not been defined"); } function o() { throw new Error("clearTimeout has not been defined"); } (function() { try { if (typeof setTimeout === "function") { r = setTimeout; } else { r = i; } } catch (t) { r = i; } try { if (typeof clearTimeout === "function") { n = clearTimeout; } else { n = o; } } catch (e) { n = o; } })(); function s(t) { if (r === setTimeout) { return setTimeout(t, 0); } if ((r === i || !r) && setTimeout) { r = setTimeout; return setTimeout(t, 0); } try { return r(t, 0); } catch (n) { try { return r.call(null, t, 0); } catch (e) { return r.call(this, t, 0); } } } function a(t) { if (n === clearTimeout) { return clearTimeout(t); } if ((n === o || !n) && clearTimeout) { n = clearTimeout; return clearTimeout(t); } try { return n(t); } catch (r) { try { return n.call(null, t); } catch (e) { return n.call(this, t); } } } var f = []; var u = false; var c; var l = -1; function h() { if (!u || !c) { return; } u = false; if (c.length) { f = c.concat(f); } else { l = -1; } if (f.length) { d(); } } function d() { if (u) { return; } var t = s(h); u = true; var e = f.length; while(e){ c = f; f = []; while(++l < e){ if (c) { c[l].run(); } } l = -1; e = f.length; } c = null; u = false; a(t); } e.nextTick = function(t) { var e = new Array(arguments.length - 1); if (arguments.length > 1) { for(var r = 1; r < arguments.length; r++){ e[r - 1] = arguments[r]; } } f.push(new p(t, e)); if (f.length === 1 && !u) { s(d); } }; function p(t, e) { this.fun = t; this.array = e; } p.prototype.run = function() { this.fun.apply(null, this.array); }; e.title = "browser"; e.browser = true; e.env = {}; e.argv = []; e.version = ""; e.versions = {}; function g() {} e.on = g; e.addListener = g; e.once = g; e.off = g; e.removeListener = g; e.removeAllListeners = g; e.emit = g; e.prependListener = g; e.prependOnceListener = g; e.listeners = function(t) { return []; }; e.binding = function(t) { throw new Error("process.binding is not supported"); }; e.cwd = function() { return "/"; }; e.chdir = function(t) { throw new Error("process.chdir is not supported"); }; e.umask = function() { return 0; }; } }; var n = {}; function i(t) { var e = n[t]; if (e !== undefined) { return e.exports; } var o = n[t] = { exports: {} }; var s = true; try { r[t](o, o.exports, i); s = false; } finally{ if (s) delete n[t]; } return o.exports; } if (typeof i !== "undefined") i.ab = e + "/"; var o = i(308); t.exports = o; })(); }), 9681: (function(t, e, r) { var n = "/"; var i = r(3454); (function() { var e = { 140: function(t) { if (typeof Object.create === "function") { t.exports = function t(e, r) { if (r) { e.super_ = r; e.prototype = Object.create(r.prototype, { constructor: { value: e, enumerable: false, writable: true, configurable: true } }); } }; } else { t.exports = function t(e, r) { if (r) { e.super_ = r; var n = function() {}; n.prototype = r.prototype; e.prototype = new n; e.prototype.constructor = e; } }; } }, 349: function(t) { "use strict"; const e = {}; function r(t, r, n) { if (!n) { n = Error; } function i(t, e, n) { if (typeof r === "string") { return r; } else { return r(t, e, n); } } class o extends n { constructor(t, e, r){ super(i(t, e, r)); } } o.prototype.name = n.name; o.prototype.code = t; e[t] = o; } function n(t, e) { if (Array.isArray(t)) { const r = t.length; t = t.map(((t)=>String(t))); if (r > 2) { return `one of ${e} ${t.slice(0, r - 1).join(", ")}, or ` + t[r - 1]; } else if (r === 2) { return `one of ${e} ${t[0]} or ${t[1]}`; } else { return `of ${e} ${t[0]}`; } } else { return `of ${e} ${String(t)}`; } } function i(t, e, r) { return t.substr(!r || r < 0 ? 0 : +r, e.length) === e; } function o(t, e, r) { if (r === undefined || r > t.length) { r = t.length; } return t.substring(r - e.length, r) === e; } function s(t, e, r) { if (typeof r !== "number") { r = 0; } if (r + e.length > t.length) { return false; } else { return t.indexOf(e, r) !== -1; } } r("ERR_INVALID_OPT_VALUE", (function(t, e) { return 'The value "' + e + '" is invalid for option "' + t + '"'; }), TypeError); r("ERR_INVALID_ARG_TYPE", (function(t, e, r) { let a; if (typeof e === "string" && i(e, "not ")) { a = "must not be"; e = e.replace(/^not /, ""); } else { a = "must be"; } let f; if (o(t, " argument")) { f = `The ${t} ${a} ${n(e, "type")}`; } else { const u = s(t, ".") ? "property" : "argument"; f = `The "${t}" ${u} ${a} ${n(e, "type")}`; } f += `. Received type ${typeof r}`; return f; }), TypeError); r("ERR_STREAM_PUSH_AFTER_EOF", "stream.push() after EOF"); r("ERR_METHOD_NOT_IMPLEMENTED", (function(t) { return "The " + t + " method is not implemented"; })); r("ERR_STREAM_PREMATURE_CLOSE", "Premature close"); r("ERR_STREAM_DESTROYED", (function(t) { return "Cannot call " + t + " after a stream was destroyed"; })); r("ERR_MULTIPLE_CALLBACK", "Callback called multiple times"); r("ERR_STREAM_CANNOT_PIPE", "Cannot pipe, not readable"); r("ERR_STREAM_WRITE_AFTER_END", "write after end"); r("ERR_STREAM_NULL_VALUES", "May not write null values to stream", TypeError); r("ERR_UNKNOWN_ENCODING", (function(t) { return "Unknown encoding: " + t; }), TypeError); r("ERR_STREAM_UNSHIFT_AFTER_END_EVENT", "stream.unshift() after end event"); t.exports.q = e; }, 716: function(t, e, r) { "use strict"; var n = Object.keys || function(t) { var e = []; for(var r in t){ e.push(r); } return e; }; t.exports = c; var o = r(787); var s = r(513); r(140)(c, o); { var a = n(s.prototype); for(var f = 0; f < a.length; f++){ var u = a[f]; if (!c.prototype[u]) c.prototype[u] = s.prototype[u]; } } function c(t) { if (!(this instanceof c)) return new c(t); o.call(this, t); s.call(this, t); this.allowHalfOpen = true; if (t) { if (t.readable === false) this.readable = false; if (t.writable === false) this.writable = false; if (t.allowHalfOpen === false) { this.allowHalfOpen = false; this.once("end", l); } } } Object.defineProperty(c.prototype, "writableHighWaterMark", { enumerable: false, get: function t() { return this._writableState.highWaterMark; } }); Object.defineProperty(c.prototype, "writableBuffer", { enumerable: false, get: function t() { return this._writableState && this._writableState.getBuffer(); } }); Object.defineProperty(c.prototype, "writableLength", { enumerable: false, get: function t() { return this._writableState.length; } }); function l() { if (this._writableState.ended) return; i.nextTick(h, this); } function h(t) { t.end(); } Object.defineProperty(c.prototype, "destroyed", { enumerable: false, get: function t() { if (this._readableState === undefined || this._writableState === undefined) { return false; } return this._readableState.destroyed && this._writableState.destroyed; }, set: function t(e) { if (this._readableState === undefined || this._writableState === undefined) { return; } this._readableState.destroyed = e; this._writableState.destroyed = e; } }); }, 788: function(t, e, r) { "use strict"; t.exports = i; var n = r(551); r(140)(i, n); function i(t) { if (!(this instanceof i)) return new i(t); n.call(this, t); } i.prototype._transform = function(t, e, r) { r(null, t); }; }, 787: function(t, e, n) { "use strict"; t.exports = R; var o; R.ReadableState = I; var s = n(361).EventEmitter; var a = function t(e, r) { return e.listeners(r).length; }; var f = n(455); var u = n(300).Buffer; var c = r.g.Uint8Array || function() {}; function l(t) { return u.from(t); } function h(t) { return u.isBuffer(t) || t instanceof c; } var d = n(837); var p; if (d && d.debuglog) { p = d.debuglog("stream"); } else { p = function t() {}; } var g = n(41); var b = n(289); var v = n(483), y = v.getHighWaterMark; var m = n(349).q, w = m.ERR_INVALID_ARG_TYPE, _ = m.ERR_STREAM_PUSH_AFTER_EOF, S = m.ERR_METHOD_NOT_IMPLEMENTED, E = m.ERR_STREAM_UNSHIFT_AFTER_END_EVENT; var x; var M; var T; n(140)(R, f); var A = b.errorOrDestroy; var O = [ "error", "close", "destroy", "pause", "resume" ]; function k(t, e, r) { if (typeof t.prependListener === "function") return t.prependListener(e, r); if (!t._events || !t._events[e]) t.on(e, r); else if (Array.isArray(t._events[e])) t._events[e].unshift(r); else t._events[e] = [ r, t._events[e] ]; } function I(t, e, r) { o = o || n(716); t = t || {}; if (typeof r !== "boolean") r = e instanceof o; this.objectMode = !!t.objectMode; if (r) this.objectMode = this.objectMode || !!t.readableObjectMode; this.highWaterMark = y(this, t, "readableHighWaterMark", r); this.buffer = new g; this.length = 0; this.pipes = null; this.pipesCount = 0; this.flowing = null; this.ended = false; this.endEmitted = false; this.reading = false; this.sync = true; this.needReadable = false; this.emittedReadable = false; this.readableListening = false; this.resumeScheduled = false; this.paused = true; this.emitClose = t.emitClose !== false; this.autoDestroy = !!t.autoDestroy; this.destroyed = false; this.defaultEncoding = t.defaultEncoding || "utf8"; this.awaitDrain = 0; this.readingMore = false; this.decoder = null; this.encoding = null; if (t.encoding) { if (!x) x = n(862).s; this.decoder = new x(t.encoding); this.encoding = t.encoding; } } function R(t) { o = o || n(716); if (!(this instanceof R)) return new R(t); var e = this instanceof o; this._readableState = new I(t, this, e); this.readable = true; if (t) { if (typeof t.read === "function") this._read = t.read; if (typeof t.destroy === "function") this._destroy = t.destroy; } f.call(this); } Object.defineProperty(R.prototype, "destroyed", { enumerable: false, get: function t() { if (this._readableState === undefined) { return false; } return this._readableState.destroyed; }, set: function t(e) { if (!this._readableState) { return; } this._readableState.destroyed = e; } }); R.prototype.destroy = b.destroy; R.prototype._undestroy = b.undestroy; R.prototype._destroy = function(t, e) { e(t); }; R.prototype.push = function(t, e) { var r = this._readableState; var n; if (!r.objectMode) { if (typeof t === "string") { e = e || r.defaultEncoding; if (e !== r.encoding) { t = u.from(t, e); e = ""; } n = true; } } else { n = true; } return N(this, t, e, false, n); }; R.prototype.unshift = function(t) { return N(this, t, null, true, false); }; function N(t, e, r, n, i) { p("readableAddChunk", e); var o = t._readableState; if (e === null) { o.reading = false; U(t, o); } else { var s; if (!i) s = P(o, e); if (s) { A(t, s); } else if (o.objectMode || e && e.length > 0) { if (typeof e !== "string" && !o.objectMode && Object.getPrototypeOf(e) !== u.prototype) { e = l(e); } if (n) { if (o.endEmitted) A(t, new E); else j(t, o, e, true); } else if (o.ended) { A(t, new _); } else if (o.destroyed) { return false; } else { o.reading = false; if (o.decoder && !r) { e = o.decoder.write(e); if (o.objectMode || e.length !== 0) j(t, o, e, false); else F(t, o); } else { j(t, o, e, false); } } } else if (!n) { o.reading = false; F(t, o); } } return !o.ended && (o.length < o.highWaterMark || o.length === 0); } function j(t, e, r, n) { if (e.flowing && e.length === 0 && !e.sync) { e.awaitDrain = 0; t.emit("data", r); } else { e.length += e.objectMode ? 1 : r.length; if (n) e.buffer.unshift(r); else e.buffer.push(r); if (e.needReadable) D(t); } F(t, e); } function P(t, e) { var r; if (!h(e) && typeof e !== "string" && e !== undefined && !t.objectMode) { r = new w("chunk", [ "string", "Buffer", "Uint8Array" ], e); } return r; } R.prototype.isPaused = function() { return this._readableState.flowing === false; }; R.prototype.setEncoding = function(t) { if (!x) x = n(862).s; var e = new x(t); this._readableState.decoder = e; this._readableState.encoding = this._readableState.decoder.encoding; var r = this._readableState.buffer.head; var i = ""; while(r !== null){ i += e.write(r.data); r = r.next; } this._readableState.buffer.clear(); if (i !== "") this._readableState.buffer.push(i); this._readableState.length = i.length; return this; }; var C = 1073741824; function B(t) { if (t >= C) { t = C; } else { t--; t |= t >>> 1; t |= t >>> 2; t |= t >>> 4; t |= t >>> 8; t |= t >>> 16; t++; } return t; } function L(t, e) { if (t <= 0 || e.length === 0 && e.ended) return 0; if (e.objectMode) return 1; if (t !== t) { if (e.flowing && e.length) return e.buffer.head.data.length; else return e.length; } if (t > e.highWaterMark) e.highWaterMark = B(t); if (t <= e.length) return t; if (!e.ended) { e.needReadable = true; return 0; } return e.length; } R.prototype.read = function(t) { p("read", t); t = parseInt(t, 10); var e = this._readableState; var r = t; if (t !== 0) e.emittedReadable = false; if (t === 0 && e.needReadable && ((e.highWaterMark !== 0 ? e.length >= e.highWaterMark : e.length > 0) || e.ended)) { p("read: emitReadable", e.length, e.ended); if (e.length === 0 && e.ended) X(this); else D(this); return null; } t = L(t, e); if (t === 0 && e.ended) { if (e.length === 0) X(this); return null; } var n = e.needReadable; p("need readable", n); if (e.length === 0 || e.length - t < e.highWaterMark) { n = true; p("length less than watermark", n); } if (e.ended || e.reading) { n = false; p("reading or ended", n); } else if (n) { p("do read"); e.reading = true; e.sync = true; if (e.length === 0) e.needReadable = true; this._read(e.highWaterMark); e.sync = false; if (!e.reading) t = L(r, e); } var i; if (t > 0) i = J(t, e); else i = null; if (i === null) { e.needReadable = e.length <= e.highWaterMark; t = 0; } else { e.length -= t; e.awaitDrain = 0; } if (e.length === 0) { if (!e.ended) e.needReadable = true; if (r !== t && e.ended) X(this); } if (i !== null) this.emit("data", i); return i; }; function U(t, e) { p("onEofChunk"); if (e.ended) return; if (e.decoder) { var r = e.decoder.end(); if (r && r.length) { e.buffer.push(r); e.length += e.objectMode ? 1 : r.length; } } e.ended = true; if (e.sync) { D(t); } else { e.needReadable = false; if (!e.emittedReadable) { e.emittedReadable = true; $(t); } } } function D(t) { var e = t._readableState; p("emitReadable", e.needReadable, e.emittedReadable); e.needReadable = false; if (!e.emittedReadable) { p("emitReadable", e.flowing); e.emittedReadable = true; i.nextTick($, t); } } function $(t) { var e = t._readableState; p("emitReadable_", e.destroyed, e.length, e.ended); if (!e.destroyed && (e.length || e.ended)) { t.emit("readable"); e.emittedReadable = false; } e.needReadable = !e.flowing && !e.ended && e.length <= e.highWaterMark; H(t); } function F(t, e) { if (!e.readingMore) { e.readingMore = true; i.nextTick(W, t, e); } } function W(t, e) { while(!e.reading && !e.ended && (e.length < e.highWaterMark || e.flowing && e.length === 0)){ var r = e.length; p("maybeReadMore read 0"); t.read(0); if (r === e.length) break; } e.readingMore = false; } R.prototype._read = function(t) { A(this, new S("_read()")); }; R.prototype.pipe = function(t, e) { var r = this; var n = this._readableState; switch(n.pipesCount){ case 0: n.pipes = t; break; case 1: n.pipes = [ n.pipes, t ]; break; default: n.pipes.push(t); break; } n.pipesCount += 1; p("pipe count=%d opts=%j", n.pipesCount, e); var o = (!e || e.end !== false) && t !== i.stdout && t !== i.stderr; var s = o ? u : y; if (n.endEmitted) i.nextTick(s); else r.once("end", s); t.on("unpipe", f); function f(t, e) { p("onunpipe"); if (t === r) { if (e && e.hasUnpiped === false) { e.hasUnpiped = true; h(); } } } function u() { p("onend"); t.end(); } var c = q(r); t.on("drain", c); var l = false; function h() { p("cleanup"); t.removeListener("close", b); t.removeListener("finish", v); t.removeListener("drain", c); t.removeListener("error", g); t.removeListener("unpipe", f); r.removeListener("end", u); r.removeListener("end", y); r.removeListener("data", d); l = true; if (n.awaitDrain && (!t._writableState || t._writableState.needDrain)) c(); } r.on("data", d); function d(e) { p("ondata"); var i = t.write(e); p("dest.write", i); if (i === false) { if ((n.pipesCount === 1 && n.pipes === t || n.pipesCount > 1 && Z(n.pipes, t) !== -1) && !l) { p("false write response, pause", n.awaitDrain); n.awaitDrain++; } r.pause(); } } function g(e) { p("onerror", e); y(); t.removeListener("error", g); if (a(t, "error") === 0) A(t, e); } k(t, "error", g); function b() { t.removeListener("finish", v); y(); } t.once("close", b); function v() { p("onfinish"); t.removeListener("close", b); y(); } t.once("finish", v); function y() { p("unpipe"); r.unpipe(t); } t.emit("pipe", r); if (!n.flowing) { p("pipe resume"); r.resume(); } return t; }; function q(t) { return function e() { var r = t._readableState; p("pipeOnDrain", r.awaitDrain); if (r.awaitDrain) r.awaitDrain--; if (r.awaitDrain === 0 && a(t, "data")) { r.flowing = true; H(t); } }; } R.prototype.unpipe = function(t) { var e = this._readableState; var r = { hasUnpiped: false }; if (e.pipesCount === 0) return this; if (e.pipesCount === 1) { if (t && t !== e.pipes) return this; if (!t) t = e.pipes; e.pipes = null; e.pipesCount = 0; e.flowing = false; if (t) t.emit("unpipe", this, r); return this; } if (!t) { var n = e.pipes; var i = e.pipesCount; e.pipes = null; e.pipesCount = 0; e.flowing = false; for(var o = 0; o < i; o++){ n[o].emit("unpipe", this, { hasUnpiped: false }); } return this; } var s = Z(e.pipes, t); if (s === -1) return this; e.pipes.splice(s, 1); e.pipesCount -= 1; if (e.pipesCount === 1) e.pipes = e.pipes[0]; t.emit("unpipe", this, r); return this; }; R.prototype.on = function(t, e) { var r = f.prototype.on.call(this, t, e); var n = this._readableState; if (t === "data") { n.readableListening = this.listenerCount("readable") > 0; if (n.flowing !== false) this.resume(); } else if (t === "readable") { if (!n.endEmitted && !n.readableListening) { n.readableListening = n.needReadable = true; n.flowing = false; n.emittedReadable = false; p("on readable", n.length, n.reading); if (n.length) { D(this); } else if (!n.reading) { i.nextTick(G, this); } } } return r; }; R.prototype.addListener = R.prototype.on; R.prototype.removeListener = function(t, e) { var r = f.prototype.removeListener.call(this, t, e); if (t === "readable") { i.nextTick(z, this); } return r; }; R.prototype.removeAllListeners = function(t) { var e = f.prototype.removeAllListeners.apply(this, arguments); if (t === "readable" || t === undefined) { i.nextTick(z, this); } return e; }; function z(t) { var e = t._readableState; e.readableListening = t.listenerCount("readable") > 0; if (e.resumeScheduled && !e.paused) { e.flowing = true; } else if (t.listenerCount("data") > 0) { t.resume(); } } function G(t) { p("readable nexttick read 0"); t.read(0); } R.prototype.resume = function() { var t = this._readableState; if (!t.flowing) { p("resume"); t.flowing = !t.readableListening; K(this, t); } t.paused = false; return this; }; function K(t, e) { if (!e.resumeScheduled) { e.resumeScheduled = true; i.nextTick(V, t, e); } } function V(t, e) { p("resume", e.reading); if (!e.reading) { t.read(0); } e.resumeScheduled = false; t.emit("resume"); H(t); if (e.flowing && !e.reading) t.read(0); } R.prototype.pause = function() { p("call pause flowing=%j", this._readableState.flowing); if (this._readableState.flowing !== false) { p("pause"); this._readableState.flowing = false; this.emit("pause"); } this._readableState.paused = true; return this; }; function H(t) { var e = t._readableState; p("flow", e.flowing); while(e.flowing && t.read() !== null){} } R.prototype.wrap = function(t) { var e = this; var r = this._readableState; var n = false; t.on("end", (function() { p("wrapped end"); if (r.decoder && !r.ended) { var t = r.decoder.end(); if (t && t.length) e.push(t); } e.push(null); })); t.on("data", (function(i) { p("wrapped data"); if (r.decoder) i = r.decoder.write(i); if (r.objectMode && (i === null || i === undefined)) return; else if (!r.objectMode && (!i || !i.length)) return; var o = e.push(i); if (!o) { n = true; t.pause(); } })); for(var i in t){ if (this[i] === undefined && typeof t[i] === "function") { this[i] = function e(r) { return function e() { return t[r].apply(t, arguments); }; }(i); } } for(var o = 0; o < O.length; o++){ t.on(O[o], this.emit.bind(this, O[o])); } this._read = function(e) { p("wrapped _read", e); if (n) { n = false; t.resume(); } }; return this; }; if (typeof Symbol === "function") { R.prototype[Symbol.asyncIterator] = function() { if (M === undefined) { M = n(224); } return M(this); }; } Object.defineProperty(R.prototype, "readableHighWaterMark", { enumerable: false, get: function t() { return this._readableState.highWaterMark; } }); Object.defineProperty(R.prototype, "readableBuffer", { enumerable: false, get: function t() { return this._readableState && this._readableState.buffer; } }); Object.defineProperty(R.prototype, "readableFlowing", { enumerable: false, get: function t() { return this._readableState.flowing; }, set: function t(e) { if (this._readableState) { this._readableState.flowing = e; } } }); R._fromList = J; Object.defineProperty(R.prototype, "readableLength", { enumerable: false, get: function t() { return this._readableState.length; } }); function J(t, e) { if (e.length === 0) return null; var r; if (e.objectMode) r = e.buffer.shift(); else if (!t || t >= e.length) { if (e.decoder) r = e.buffer.join(""); else if (e.buffer.length === 1) r = e.buffer.first(); else r = e.buffer.concat(e.length); e.buffer.clear(); } else { r = e.buffer.consume(t, e.decoder); } return r; } function X(t) { var e = t._readableState; p("endReadable", e.endEmitted); if (!e.endEmitted) { e.ended = true; i.nextTick(Y, e, t); } } function Y(t, e) { p("endReadableNT", t.endEmitted, t.length); if (!t.endEmitted && t.length === 0) { t.endEmitted = true; e.readable = false; e.emit("end"); if (t.autoDestroy) { var r = e._writableState; if (!r || r.autoDestroy && r.finished) { e.destroy(); } } } } if (typeof Symbol === "function") { R.from = function(t, e) { if (T === undefined) { T = n(720); } return T(R, t, e); }; } function Z(t, e) { for(var r = 0, n = t.length; r < n; r++){ if (t[r] === e) return r; } return -1; } }, 551: function(t, e, r) { "use strict"; t.exports = c; var n = r(349).q, i = n.ERR_METHOD_NOT_IMPLEMENTED, o = n.ERR_MULTIPLE_CALLBACK, s = n.ERR_TRANSFORM_ALREADY_TRANSFORMING, a = n.ERR_TRANSFORM_WITH_LENGTH_0; var f = r(716); r(140)(c, f); function u(t, e) { var r = this._transformState; r.transforming = false; var n = r.writecb; if (n === null) { return this.emit("error", new o); } r.writechunk = null; r.writecb = null; if (e != null) this.push(e); n(t); var i = this._readableState; i.reading = false; if (i.needReadable || i.length < i.highWaterMark) { this._read(i.highWaterMark); } } function c(t) { if (!(this instanceof c)) return new c(t); f.call(this, t); this._transformState = { afterTransform: u.bind(this), needTransform: false, transforming: false, writecb: null, writechunk: null, writeencoding: null }; this._readableState.needReadable = true; this._readableState.sync = false; if (t) { if (typeof t.transform === "function") this._transform = t.transform; if (typeof t.flush === "function") this._flush = t.flush; } this.on("prefinish", l); } function l() { var t = this; if (typeof this._flush === "function" && !this._readableState.destroyed) { this._flush((function(e, r) { h(t, e, r); })); } else { h(this, null, null); } } c.prototype.push = function(t, e) { this._transformState.needTransform = false; return f.prototype.push.call(this, t, e); }; c.prototype._transform = function(t, e, r) { r(new i("_transform()")); }; c.prototype._write = function(t, e, r) { var n = this._transformState; n.writecb = r; n.writechunk = t; n.writeencoding = e; if (!n.transforming) { var i = this._readableState; if (n.needTransform || i.needReadable || i.length < i.highWaterMark) this._read(i.highWaterMark); } }; c.prototype._read = function(t) { var e = this._transformState; if (e.writechunk !== null && !e.transforming) { e.transforming = true; this._transform(e.writechunk, e.writeencoding, e.afterTransform); } else { e.needTransform = true; } }; c.prototype._destroy = function(t, e) { f.prototype._destroy.call(this, t, (function(t) { e(t); })); }; function h(t, e, r) { if (e) return t.emit("error", e); if (r != null) t.push(r); if (t._writableState.length) throw new a; if (t._transformState.transforming) throw new s; return t.push(null); } }, 513: function(t, e, n) { "use strict"; t.exports = I; function o(t, e, r) { this.chunk = t; this.encoding = e; this.callback = r; this.next = null; } function s(t) { var e = this; this.next = null; this.entry = null; this.finish = function() { V(e, t); }; } var a; I.WritableState = O; var f = { deprecate: n(777) }; var u = n(455); var c = n(300).Buffer; var l = r.g.Uint8Array || function() {}; function h(t) { return c.from(t); } function d(t) { return c.isBuffer(t) || t instanceof l; } var p = n(289); var g = n(483), b = g.getHighWaterMark; var v = n(349).q, y = v.ERR_INVALID_ARG_TYPE, m = v.ERR_METHOD_NOT_IMPLEMENTED, w = v.ERR_MULTIPLE_CALLBACK, _ = v.ERR_STREAM_CANNOT_PIPE, S = v.ERR_STREAM_DESTROYED, E = v.ERR_STREAM_NULL_VALUES, x = v.ERR_STREAM_WRITE_AFTER_END, M = v.ERR_UNKNOWN_ENCODING; var T = p.errorOrDestroy; n(140)(I, u); function A() {} function O(t, e, r) { a = a || n(716); t = t || {}; if (typeof r !== "boolean") r = e instanceof a; this.objectMode = !!t.objectMode; if (r) this.objectMode = this.objectMode || !!t.writableObjectMode; this.highWaterMark = b(this, t, "writableHighWaterMark", r); this.finalCalled = false; this.needDrain = false; this.ending = false; this.ended = false; this.finished = false; this.destroyed = false; var i = t.decodeStrings === false; this.decodeStrings = !i; this.defaultEncoding = t.defaultEncoding || "utf8"; this.length = 0; this.writing = false; this.corked = 0; this.sync = true; this.bufferProcessing = false; this.onwrite = function(t) { U(e, t); }; this.writecb = null; this.writelen = 0; this.bufferedRequest = null; this.lastBufferedRequest = null; this.pendingcb = 0; this.prefinished = false; this.errorEmitted = false; this.emitClose = t.emitClose !== false; this.autoDestroy = !!t.autoDestroy; this.bufferedRequestCount = 0; this.corkedRequestsFree = new s(this); } O.prototype.getBuffer = function t() { var e = this.bufferedRequest; var r = []; while(e){ r.push(e); e = e.next; } return r; }; (function() { try { Object.defineProperty(O.prototype, "buffer", { get: f.deprecate((function t() { return this.getBuffer(); }), "_writableState.buffer is deprecated. Use _writableState.getBuffer " + "instead.", "DEP0003") }); } catch (t) {} })(); var k; if (typeof Symbol === "function" && Symbol.hasInstance && typeof Function.prototype[Symbol.hasInstance] === "function") { k = Function.prototype[Symbol.hasInstance]; Object.defineProperty(I, Symbol.hasInstance, { value: function t(e) { if (k.call(this, e)) return true; if (this !== I) return false; return e && e._writableState instanceof O; } }); } else { k = function t(e) { return e instanceof this; }; } function I(t) { a = a || n(716); var e = this instanceof a; if (!e && !k.call(I, this)) return new I(t); this._writableState = new O(t, this, e); this.writable = true; if (t) { if (typeof t.write === "function") this._write = t.write; if (typeof t.writev === "function") this._writev = t.writev; if (typeof t.destroy === "function") this._destroy = t.destroy; if (typeof t.final === "function") this._final = t.final; } u.call(this); } I.prototype.pipe = function() { T(this, new _); }; function R(t, e) { var r = new x; T(t, r); i.nextTick(e, r); } function N(t, e, r, n) { var o; if (r === null) { o = new E; } else if (typeof r !== "string" && !e.objectMode) { o = new y("chunk", [ "string", "Buffer" ], r); } if (o) { T(t, o); i.nextTick(n, o); return false; } return true; } I.prototype.write = function(t, e, r) { var n = this._writableState; var i = false; var o = !n.objectMode && d(t); if (o && !c.isBuffer(t)) { t = h(t); } if (typeof e === "function") { r = e; e = null; } if (o) e = "buffer"; else if (!e) e = n.defaultEncoding; if (typeof r !== "function") r = A; if (n.ending) R(this, r); else if (o || N(this, n, t, r)) { n.pendingcb++; i = P(this, n, o, t, e, r); } return i; }; I.prototype.cork = function() { this._writableState.corked++; }; I.prototype.uncork = function() { var t = this._writableState; if (t.corked) { t.corked--; if (!t.writing && !t.corked && !t.bufferProcessing && t.bufferedRequest) F(this, t); } }; I.prototype.setDefaultEncoding = function t(e) { if (typeof e === "string") e = e.toLowerCase(); if (!([ "hex", "utf8", "utf-8", "ascii", "binary", "base64", "ucs2", "ucs-2", "utf16le", "utf-16le", "raw" ].indexOf((e + "").toLowerCase()) > -1)) throw new M(e); this._writableState.defaultEncoding = e; return this; }; Object.defineProperty(I.prototype, "writableBuffer", { enumerable: false, get: function t() { return this._writableState && this._writableState.getBuffer(); } }); function j(t, e, r) { if (!t.objectMode && t.decodeStrings !== false && typeof e === "string") { e = c.from(e, r); } return e; } Object.defineProperty(I.prototype, "writableHighWaterMark", { enumerable: false, get: function t() { return this._writableState.highWaterMark; } }); function P(t, e, r, n, i, o) { if (!r) { var s = j(e, n, i); if (n !== s) { r = true; i = "buffer"; n = s; } } var a = e.objectMode ? 1 : n.length; e.length += a; var f = e.length < e.highWaterMark; if (!f) e.needDrain = true; if (e.writing || e.corked) { var u = e.lastBufferedRequest; e.lastBufferedRequest = { chunk: n, encoding: i, isBuf: r, callback: o, next: null }; if (u) { u.next = e.lastBufferedRequest; } else { e.bufferedRequest = e.lastBufferedRequest; } e.bufferedRequestCount += 1; } else { C(t, e, false, a, n, i, o); } return f; } function C(t, e, r, n, i, o, s) { e.writelen = n; e.writecb = s; e.writing = true; e.sync = true; if (e.destroyed) e.onwrite(new S("write")); else if (r) t._writev(i, e.onwrite); else t._write(i, o, e.onwrite); e.sync = false; } function B(t, e, r, n, o) { --e.pendingcb; if (r) { i.nextTick(o, n); i.nextTick(G, t, e); t._writableState.errorEmitted = true; T(t, n); } else { o(n); t._writableState.errorEmitted = true; T(t, n); G(t, e); } } function L(t) { t.writing = false; t.writecb = null; t.length -= t.writelen; t.writelen = 0; } function U(t, e) { var r = t._writableState; var n = r.sync; var o = r.writecb; if (typeof o !== "function") throw new w; L(r); if (e) B(t, r, n, e, o); else { var s = W(r) || t.destroyed; if (!s && !r.corked && !r.bufferProcessing && r.bufferedRequest) { F(t, r); } if (n) { i.nextTick(D, t, r, s, o); } else { D(t, r, s, o); } } } function D(t, e, r, n) { if (!r) $(t, e); e.pendingcb--; n(); G(t, e); } function $(t, e) { if (e.length === 0 && e.needDrain) { e.needDrain = false; t.emit("drain"); } } function F(t, e) { e.bufferProcessing = true; var r = e.bufferedRequest; if (t._writev && r && r.next) { var n = e.bufferedRequestCount; var i = new Array(n); var o = e.corkedRequestsFree; o.entry = r; var a = 0; var f = true; while(r){ i[a] = r; if (!r.isBuf) f = false; r = r.next; a += 1; } i.allBuffers = f; C(t, e, true, e.length, i, "", o.finish); e.pendingcb++; e.lastBufferedRequest = null; if (o.next) { e.corkedRequestsFree = o.next; o.next = null; } else { e.corkedRequestsFree = new s(e); } e.bufferedRequestCount = 0; } else { while(r){ var u = r.chunk; var c = r.encoding; var l = r.callback; var h = e.objectMode ? 1 : u.length; C(t, e, false, h, u, c, l); r = r.next; e.bufferedRequestCount--; if (e.writing) { break; } } if (r === null) e.lastBufferedRequest = null; } e.bufferedRequest = r; e.bufferProcessing = false; } I.prototype._write = function(t, e, r) { r(new m("_write()")); }; I.prototype._writev = null; I.prototype.end = function(t, e, r) { var n = this._writableState; if (typeof t === "function") { r = t; t = null; e = null; } else if (typeof e === "function") { r = e; e = null; } if (t !== null && t !== undefined) this.write(t, e); if (n.corked) { n.corked = 1; this.uncork(); } if (!n.ending) K(this, n, r); return this; }; Object.defineProperty(I.prototype, "writableLength", { enumerable: false, get: function t() { return this._writableState.length; } }); function W(t) { return t.ending && t.length === 0 && t.bufferedRequest === null && !t.finished && !t.writing; } function q(t, e) { t._final((function(r) { e.pendingcb--; if (r) { T(t, r); } e.prefinished = true; t.emit("prefinish"); G(t, e); })); } function z(t, e) { if (!e.prefinished && !e.finalCalled) { if (typeof t._final === "function" && !e.destroyed) { e.pendingcb++; e.finalCalled = true; i.nextTick(q, t, e); } else { e.prefinished = true; t.emit("prefinish"); } } } function G(t, e) { var r = W(e); if (r) { z(t, e); if (e.pendingcb === 0) { e.finished = true; t.emit("finish"); if (e.autoDestroy) { var n = t._readableState; if (!n || n.autoDestroy && n.endEmitted) { t.destroy(); } } } } return r; } function K(t, e, r) { e.ending = true; G(t, e); if (r) { if (e.finished) i.nextTick(r); else t.once("finish", r); } e.ended = true; t.writable = false; } function V(t, e, r) { var n = t.entry; t.entry = null; while(n){ var i = n.callback; e.pendingcb--; i(r); n = n.next; } e.corkedRequestsFree.next = t; } Object.defineProperty(I.prototype, "destroyed", { enumerable: false, get: function t() { if (this._writableState === undefined) { return false; } return this._writableState.destroyed; }, set: function t(e) { if (!this._writableState) { return; } this._writableState.destroyed = e; } }); I.prototype.destroy = p.destroy; I.prototype._undestroy = p.undestroy; I.prototype._destroy = function(t, e) { e(t); }; }, 224: function(t, e, r) { "use strict"; var n; function o(t, e, r) { if (e in t) { Object.defineProperty(t, e, { value: r, enumerable: true, configurable: true, writable: true }); } else { t[e] = r; } return t; } var s = r(7); var a = Symbol("lastResolve"); var f = Symbol("lastReject"); var u = Symbol("error"); var c = Symbol("ended"); var l = Symbol("lastPromise"); var h = Symbol("handlePromise"); var d = Symbol("stream"); function p(t, e) { return { value: t, done: e }; } function g(t) { var e = t[a]; if (e !== null) { var r = t[d].read(); if (r !== null) { t[l] = null; t[a] = null; t[f] = null; e(p(r, false)); } } } function b(t) { i.nextTick(g, t); } function v(t, e) { return function(r, n) { t.then((function() { if (e[c]) { r(p(undefined, true)); return; } e[h](r, n); }), n); }; } var y = Object.getPrototypeOf((function() {})); var m = Object.setPrototypeOf((n = { get stream () { return this[d]; }, next: function t() { var e = this; var r = this[u]; if (r !== null) { return Promise.reject(r); } if (this[c]) { return Promise.resolve(p(undefined, true)); } if (this[d].destroyed) { return new Promise((function(t, r) { i.nextTick((function() { if (e[u]) { r(e[u]); } else { t(p(undefined, true)); } })); })); } var n = this[l]; var o; if (n) { o = new Promise(v(n, this)); } else { var s = this[d].read(); if (s !== null) { return Promise.resolve(p(s, false)); } o = new Promise(this[h]); } this[l] = o; return o; } }, o(n, Symbol.asyncIterator, (function() { return this; })), o(n, "return", (function t() { var e = this; return new Promise((function(t, r) { e[d].destroy(null, (function(e) { if (e) { r(e); return; } t(p(undefined, true)); })); })); })), n), y); var w = function t(e) { var r; var n = Object.create(m, (r = {}, o(r, d, { value: e, writable: true }), o(r, a, { value: null, writable: true }), o(r, f, { value: null, writable: true }), o(r, u, { value: null, writable: true }), o(r, c, { value: e._readableState.endEmitted, writable: true }), o(r, h, { value: function t(e, r) { var i = n[d].read(); if (i) { n[l] = null; n[a] = null; n[f] = null; e(p(i, false)); } else { n[a] = e; n[f] = r; } }, writable: true }), r)); n[l] = null; s(e, (function(t) { if (t && t.code !== "ERR_STREAM_PREMATURE_CLOSE") { var e = n[f]; if (e !== null) { n[l] = null; n[a] = null; n[f] = null; e(t); } n[u] = t; return; } var r = n[a]; if (r !== null) { n[l] = null; n[a] = null; n[f] = null; r(p(undefined, true)); } n[c] = true; })); e.on("readable", b.bind(null, n)); return n; }; t.exports = w; }, 41: function(t, e, r) { "use strict"; function n(t, e) { var r = Object.keys(t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(t); if (e) n = n.filter((function(e) { return Object.getOwnPropertyDescriptor(t, e).enumerable; })); r.push.apply(r, n); } return r; } function i(t) { for(var e = 1; e < arguments.length; e++){ var r = arguments[e] != null ? arguments[e] : {}; if (e % 2) { n(Object(r), true).forEach((function(e) { o(t, e, r[e]); })); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)); } else { n(Object(r)).forEach((function(e) { Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e)); })); } } return t; } function o(t, e, r) { if (e in t) { Object.defineProperty(t, e, { value: r, enumerable: true, configurable: true, writable: true }); } else { t[e] = r; } return t; } function s(t, e) { if (!(t instanceof e)) { throw new TypeError("Cannot call a class as a function"); } } function a(t, e) { for(var r = 0; r < e.length; r++){ var n = e[r]; n.enumerable = n.enumerable || false; n.configurable = true; if ("value" in n) n.writable = true; Object.defineProperty(t, n.key, n); } } function f(t, e, r) { if (e) a(t.prototype, e); if (r) a(t, r); return t; } var u = r(300), c = u.Buffer; var l = r(837), h = l.inspect; var d = h && h.custom || "inspect"; function p(t, e, r) { c.prototype.copy.call(t, e, r); } t.exports = function() { function t() { s(this, t); this.head = null; this.tail = null; this.length = 0; } f(t, [ { key: "push", value: function t(e) { var r = { data: e, next: null }; if (this.length > 0) this.tail.next = r; else this.head = r; this.tail = r; ++this.length; } }, { key: "unshift", value: function t(e) { var r = { data: e, next: this.head }; if (this.length === 0) this.tail = r; this.head = r; ++this.length; } }, { key: "shift", value: function t() { if (this.length === 0) return; var e = this.head.data; if (this.length === 1) this.head = this.tail = null; else this.head = this.head.next; --this.length; return e; } }, { key: "clear", value: function t() { this.head = this.tail = null; this.length = 0; } }, { key: "join", value: function t(e) { if (this.length === 0) return ""; var r = this.head; var n = "" + r.data; while(r = r.next){ n += e + r.data; } return n; } }, { key: "concat", value: function t(e) { if (this.length === 0) return c.alloc(0); var r = c.allocUnsafe(e >>> 0); var n = this.head; var i = 0; while(n){ p(n.data, r, i); i += n.data.length; n = n.next; } return r; } }, { key: "consume", value: function t(e, r) { var n; if (e < this.head.data.length) { n = this.head.data.slice(0, e); this.head.data = this.head.data.slice(e); } else if (e === this.head.data.length) { n = this.shift(); } else { n = r ? this._getString(e) : this._getBuffer(e); } return n; } }, { key: "first", value: function t() { return this.head.data; } }, { key: "_getString", value: function t(e) { var r = this.head; var n = 1; var i = r.data; e -= i.length; while(r = r.next){ var o = r.data; var s = e > o.length ? o.length : e; if (s === o.length) i += o; else i += o.slice(0, e); e -= s; if (e === 0) { if (s === o.length) { ++n; if (r.next) this.head = r.next; else this.head = this.tail = null; } else { this.head = r; r.data = o.slice(s); } break; } ++n; } this.length -= n; return i; } }, { key: "_getBuffer", value: function t(e) { var r = c.allocUnsafe(e); var n = this.head; var i = 1; n.data.copy(r); e -= n.data.length; while(n = n.next){ var o = n.data; var s = e > o.length ? o.length : e; o.copy(r, r.length - e, 0, s); e -= s; if (e === 0) { if (s === o.length) { ++i; if (n.next) this.head = n.next; else this.head = this.tail = null; } else { this.head = n; n.data = o.slice(s); } break; } ++i; } this.length -= i; return r; } }, { key: d, value: function t(e, r) { return h(this, i({}, r, { depth: 0, customInspect: false })); } } ]); return t; }(); }, 289: function(t) { "use strict"; function e(t, e) { var o = this; var a = this._readableState && this._readableState.destroyed; var f = this._writableState && this._writableState.destroyed; if (a || f) { if (e) { e(t); } else if (t) { if (!this._writableState) { i.nextTick(s, this, t); } else if (!this._writableState.errorEmitted) { this._writableState.errorEmitted = true; i.nextTick(s, this, t); } } return this; } if (this._readableState) { this._readableState.destroyed = true; } if (this._writableState) { this._writableState.destroyed = true; } this._destroy(t || null, (function(t) { if (!e && t) { if (!o._writableState) { i.nextTick(r, o, t); } else if (!o._writableState.errorEmitted) { o._writableState.errorEmitted = true; i.nextTick(r, o, t); } else { i.nextTick(n, o); } } else if (e) { i.nextTick(n, o); e(t); } else { i.nextTick(n, o); } })); return this; } function r(t, e) { s(t, e); n(t); } function n(t) { if (t._writableState && !t._writableState.emitClose) return; if (t._readableState && !t._readableState.emitClose) return; t.emit("close"); } function o() { if (this._readableState) { this._readableState.destroyed = false; this._readableState.reading = false; this._readableState.ended = false; this._readableState.endEmitted = false; } if (this._writableState) { this._writableState.destroyed = false; this._writableState.ended = false; this._writableState.ending = false; this._writableState.finalCalled = false; this._writableState.prefinished = false; this._writableState.finished = false; this._writableState.errorEmitted = false; } } function s(t, e) { t.emit("error", e); } function a(t, e) { var r = t._readableState; var n = t._writableState; if (r && r.autoDestroy || n && n.autoDestroy) t.destroy(e); else t.emit("error", e); } t.exports = { destroy: e, undestroy: o, errorOrDestroy: a }; }, 7: function(t, e, r) { "use strict"; var n = r(349).q.ERR_STREAM_PREMATURE_CLOSE; function i(t) { var e = false; return function() { if (e) return; e = true; for(var r = arguments.length, n = new Array(r), i = 0; i < r; i++){ n[i] = arguments[i]; } t.apply(this, n); }; } function o() {} function s(t) { return t.setHeader && typeof t.abort === "function"; } function a(t, e, r) { if (typeof e === "function") return a(t, null, e); if (!e) e = {}; r = i(r || o); var f = e.readable || e.readable !== false && t.readable; var u = e.writable || e.writable !== false && t.writable; var c = function e() { if (!t.writable) h(); }; var l = t._writableState && t._writableState.finished; var h = function e() { u = false; l = true; if (!f) r.call(t); }; var d = t._readableState && t._readableState.endEmitted; var p = function e() { f = false; d = true; if (!u) r.call(t); }; var g = function e(n) { r.call(t, n); }; var b = function e() { var i; if (f && !d) { if (!t._readableState || !t._readableState.ended) i = new n; return r.call(t, i); } if (u && !l) { if (!t._writableState || !t._writableState.ended) i = new n; return r.call(t, i); } }; var v = function e() { t.req.on("finish", h); }; if (s(t)) { t.on("complete", h); t.on("abort", b); if (t.req) v(); else t.on("request", v); } else if (u && !t._writableState) { t.on("end", c); t.on("close", c); } t.on("end", p); t.on("finish", h); if (e.error !== false) t.on("error", g); t.on("close", b); return function() { t.removeListener("complete", h); t.removeListener("abort", b); t.removeListener("request", v); if (t.req) t.req.removeListener("finish", h); t.removeListener("end", c); t.removeListener("close", c); t.removeListener("finish", h); t.removeListener("end", p); t.removeListener("error", g); t.removeListener("close", b); }; } t.exports = a; }, 720: function(t, e, r) { "use strict"; function n(t, e, r, n, i, o, s) { try { var a = t[o](s); var f = a.value; } catch (u) { r(u); return; } if (a.done) { e(f); } else { Promise.resolve(f).then(n, i); } } function i(t) { return function() { var e = this, r = arguments; return new Promise((function(i, o) { var s = t.apply(e, r); function a(t) { n(s, i, o, a, f, "next", t); } function f(t) { n(s, i, o, a, f, "throw", t); } a(undefined); })); }; } function o(t, e) { var r = Object.keys(t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(t); if (e) n = n.filter((function(e) { return Object.getOwnPropertyDescriptor(t, e).enumerable; })); r.push.apply(r, n); } return r; } function s(t) { for(var e = 1; e < arguments.length; e++){ var r = arguments[e] != null ? arguments[e] : {}; if (e % 2) { o(Object(r), true).forEach((function(e) { a(t, e, r[e]); })); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(t, Object.getOwnPropertyDescriptors(r)); } else { o(Object(r)).forEach((function(e) { Object.defineProperty(t, e, Object.getOwnPropertyDescriptor(r, e)); })); } } return t; } function a(t, e, r) { if (e in t) { Object.defineProperty(t, e, { value: r, enumerable: true, configurable: true, writable: true }); } else { t[e] = r; } return t; } var f = r(349).q.ERR_INVALID_ARG_TYPE; function u(t, e, r) { var n; if (e && typeof e.next === "function") { n = e; } else if (e && e[Symbol.asyncIterator]) n = e[Symbol.asyncIterator](); else if (e && e[Symbol.iterator]) n = e[Symbol.iterator](); else throw new f("iterable", [ "Iterable" ], e); var o = new t(s({ objectMode: true }, r)); var a = false; o._read = function() { if (!a) { a = true; u(); } }; function u() { return c.apply(this, arguments); } function c() { c = i((function*() { try { var t = yield n.next(), e = t.value, r = t.done; if (r) { o.push(null); } else if (o.push(yield e)) { u(); } else { a = false; } } catch (i) { o.destroy(i); } })); return c.apply(this, arguments); } return o; } t.exports = u; }, 522: function(t, e, r) { "use strict"; var n; function i(t) { var e = false; return function() { if (e) return; e = true; t.apply(void 0, arguments); }; } var o = r(349).q, s = o.ERR_MISSING_ARGS, a = o.ERR_STREAM_DESTROYED; function f(t) { if (t) throw t; } function u(t) { return t.setHeader && typeof t.abort === "function"; } function c(t, e, o, s) { s = i(s); var f = false; t.on("close", (function() { f = true; })); if (n === undefined) n = r(7); n(t, { readable: e, writable: o }, (function(t) { if (t) return s(t); f = true; s(); })); var c = false; return function(e) { if (f) return; if (c) return; c = true; if (u(t)) return t.abort(); if (typeof t.destroy === "function") return t.destroy(); s(e || new a("pipe")); }; } function l(t) { t(); } function h(t, e) { return t.pipe(e); } function d(t) { if (!t.length) return f; if (typeof t[t.length - 1] !== "function") return f; return t.pop(); } function p() { for(var t = arguments.length, e = new Array(t), r = 0; r < t; r++){ e[r] = arguments[r]; } var n = d(e); if (Array.isArray(e[0])) e = e[0]; if (e.length < 2) { throw new s("streams"); } var i; var o = e.map((function(t, r) { var s = r < e.length - 1; var a = r > 0; return c(t, s, a, (function(t) { if (!i) i = t; if (t) o.forEach(l); if (s) return; o.forEach(l); n(i); })); })); return e.reduce(h); } t.exports = p; }, 483: function(t, e, r) { "use strict"; var n = r(349).q.ERR_INVALID_OPT_VALUE; function i(t, e, r) { return t.highWaterMark != null ? t.highWaterMark : e ? t[r] : null; } function o(t, e, r, o) { var s = i(e, o, r); if (s != null) { if (!(isFinite(s) && Math.floor(s) === s) || s < 0) { var a = o ? r : "highWaterMark"; throw new n(a, s); } return Math.floor(s); } return t.objectMode ? 16 : 16 * 1024; } t.exports = { getHighWaterMark: o }; }, 455: function(t, e, r) { t.exports = r(781); }, 207: function(t, e, r) { var n = r(300); var i = n.Buffer; function o(t, e) { for(var r in t){ e[r] = t[r]; } } if (i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow) { t.exports = n; } else { o(n, e); e.Buffer = s; } function s(t, e, r) { return i(t, e, r); } s.prototype = Object.create(i.prototype); o(i, s); s.from = function(t, e, r) { if (typeof t === "number") { throw new TypeError("Argument must not be a number"); } return i(t, e, r); }; s.alloc = function(t, e, r) { if (typeof t !== "number") { throw new TypeError("Argument must be a number"); } var n = i(t); if (e !== undefined) { if (typeof r === "string") { n.fill(e, r); } else { n.fill(e); } } else { n.fill(0); } return n; }; s.allocUnsafe = function(t) { if (typeof t !== "number") { throw new TypeError("Argument must be a number"); } return i(t); }; s.allocUnsafeSlow = function(t) { if (typeof t !== "number") { throw new TypeError("Argument must be a number"); } return n.SlowBuffer(t); }; }, 552: function(t, e, r) { t.exports = o; var n = r(361).EventEmitter; var i = r(140); i(o, n); o.Readable = r(787); o.Writable = r(513); o.Duplex = r(716); o.Transform = r(551); o.PassThrough = r(788); o.finished = r(7); o.pipeline = r(522); o.Stream = o; function o() { n.call(this); } o.prototype.pipe = function(t, e) { var r = this; function i(e) { if (t.writable) { if (false === t.write(e) && r.pause) { r.pause(); } } } r.on("data", i); function o() { if (r.readable && r.resume) { r.resume(); } } t.on("drain", o); if (!t._isStdio && (!e || e.end !== false)) { r.on("end", a); r.on("close", f); } var s = false; function a() { if (s) return; s = true; t.end(); } function f() { if (s) return; s = true; if (typeof t.destroy === "function") t.destroy(); } function u(t) { c(); if (n.listenerCount(this, "error") === 0) { throw t; } } r.on("error", u); t.on("error", u); function c() { r.removeListener("data", i); t.removeListener("drain", o); r.removeListener("end", a); r.removeListener("close", f); r.removeListener("error", u); t.removeListener("error", u); r.removeListener("end", c); r.removeListener("close", c); t.removeListener("close", c); } r.on("end", c); r.on("close", c); t.on("close", c); t.emit("pipe", r); return t; }; }, 862: function(t, e, r) { "use strict"; var n = r(207).Buffer; var i = n.isEncoding || function(t) { t = "" + t; switch(t && t.toLowerCase()){ case "hex": case "utf8": case "utf-8": case "ascii": case "binary": case "base64": case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": case "raw": return true; default: return false; } }; function o(t) { if (!t) return "utf8"; var e; while(true){ switch(t){ case "utf8": case "utf-8": return "utf8"; case "ucs2": case "ucs-2": case "utf16le": case "utf-16le": return "utf16le"; case "latin1": case "binary": return "latin1"; case "base64": case "ascii": case "hex": return t; default: if (e) return; t = ("" + t).toLowerCase(); e = true; } } } function s(t) { var e = o(t); if (typeof e !== "string" && (n.isEncoding === i || !i(t))) throw new Error("Unknown encoding: " + t); return e || t; } e.s = a; function a(t) { this.encoding = s(t); var e; switch(this.encoding){ case "utf16le": this.text = p; this.end = g; e = 4; break; case "utf8": this.fillLast = l; e = 4; break; case "base64": this.text = b; this.end = v; e = 3; break; default: this.write = y; this.end = m; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = n.allocUnsafe(e); } a.prototype.write = function(t) { if (t.length === 0) return ""; var e; var r; if (this.lastNeed) { e = this.fillLast(t); if (e === undefined) return ""; r = this.lastNeed; this.lastNeed = 0; } else { r = 0; } if (r < t.length) return e ? e + this.text(t, r) : this.text(t, r); return e || ""; }; a.prototype.end = d; a.prototype.text = h; a.prototype.fillLast = function(t) { if (this.lastNeed <= t.length) { t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length); this.lastNeed -= t.length; }; function f(t) { if (t <= 127) return 0; else if (t >> 5 === 6) return 2; else if (t >> 4 === 14) return 3; else if (t >> 3 === 30) return 4; return t >> 6 === 2 ? -1 : -2; } function u(t, e, r) { var n = e.length - 1; if (n < r) return 0; var i = f(e[n]); if (i >= 0) { if (i > 0) t.lastNeed = i - 1; return i; } if (--n < r || i === -2) return 0; i = f(e[n]); if (i >= 0) { if (i > 0) t.lastNeed = i - 2; return i; } if (--n < r || i === -2) return 0; i = f(e[n]); if (i >= 0) { if (i > 0) { if (i === 2) i = 0; else t.lastNeed = i - 3; } return i; } return 0; } function c(t, e, r) { if ((e[0] & 192) !== 128) { t.lastNeed = 0; return "�"; } if (t.lastNeed > 1 && e.length > 1) { if ((e[1] & 192) !== 128) { t.lastNeed = 1; return "�"; } if (t.lastNeed > 2 && e.length > 2) { if ((e[2] & 192) !== 128) { t.lastNeed = 2; return "�"; } } } } function l(t) { var e = this.lastTotal - this.lastNeed; var r = c(this, t, e); if (r !== undefined) return r; if (this.lastNeed <= t.length) { t.copy(this.lastChar, e, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } t.copy(this.lastChar, e, 0, t.length); this.lastNeed -= t.length; } function h(t, e) { var r = u(this, t, e); if (!this.lastNeed) return t.toString("utf8", e); this.lastTotal = r; var n = t.length - (r - this.lastNeed); t.copy(this.lastChar, 0, n); return t.toString("utf8", e, n); } function d(t) { var e = t && t.length ? this.write(t) : ""; if (this.lastNeed) return e + "�"; return e; } function p(t, e) { if ((t.length - e) % 2 === 0) { var r = t.toString("utf16le", e); if (r) { var n = r.charCodeAt(r.length - 1); if (n >= 55296 && n <= 56319) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = t[t.length - 2]; this.lastChar[1] = t[t.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = t[t.length - 1]; return t.toString("utf16le", e, t.length - 1); } function g(t) { var e = t && t.length ? this.write(t) : ""; if (this.lastNeed) { var r = this.lastTotal - this.lastNeed; return e + this.lastChar.toString("utf16le", 0, r); } return e; } function b(t, e) { var r = (t.length - e) % 3; if (r === 0) return t.toString("base64", e); this.lastNeed = 3 - r; this.lastTotal = 3; if (r === 1) { this.lastChar[0] = t[t.length - 1]; } else { this.lastChar[0] = t[t.length - 2]; this.lastChar[1] = t[t.length - 1]; } return t.toString("base64", e, t.length - r); } function v(t) { var e = t && t.length ? this.write(t) : ""; if (this.lastNeed) return e + this.lastChar.toString("base64", 0, 3 - this.lastNeed); return e; } function y(t) { return t.toString(this.encoding); } function m(t) { return t && t.length ? this.write(t) : ""; } }, 777: function(t) { t.exports = e; function e(t, e) { if (n("noDeprecation")) { return t; } var r = false; function i() { if (!r) { if (n("throwDeprecation")) { throw new Error(e); } else if (n("traceDeprecation")) { console.trace(e); } else { console.warn(e); } r = true; } return t.apply(this, arguments); } return i; } function n(t) { try { if (!r.g.localStorage) return false; } catch (e) { return false; } var n = r.g.localStorage[t]; if (null == n) return false; return String(n).toLowerCase() === "true"; } }, 300: function(t) { "use strict"; t.exports = r(8764); }, 361: function(t) { "use strict"; t.exports = r(7187); }, 781: function(t) { "use strict"; t.exports = (r(7187).EventEmitter); }, 837: function(t) { "use strict"; t.exports = r(9539); } }; var o = {}; function s(t) { var r = o[t]; if (r !== undefined) { return r.exports; } var n = o[t] = { exports: {} }; var i = true; try { e[t](n, n.exports, s); i = false; } finally{ if (i) delete o[t]; } return n.exports; } if (typeof s !== "undefined") s.ab = n + "/"; var a = s(552); t.exports = a; })(); }), 1951: (function(module) { var __dirname = "/"; (function() { var __webpack_modules__ = { 965: function(__unused_webpack_module, exports) { var indexOf = function(t, e) { if (t.indexOf) return t.indexOf(e); else for(var r = 0; r < t.length; r++){ if (t[r] === e) return r; } return -1; }; var Object_keys = function(t) { if (Object.keys) return Object.keys(t); else { var e = []; for(var r in t)e.push(r); return e; } }; var forEach = function(t, e) { if (t.forEach) return t.forEach(e); else for(var r = 0; r < t.length; r++){ e(t[r], r, t); } }; var defineProp = function() { try { Object.defineProperty({}, "_", {}); return function(t, e, r) { Object.defineProperty(t, e, { writable: true, enumerable: false, configurable: true, value: r }); }; } catch (t) { return function(t, e, r) { t[e] = r; }; } }(); var globals = [ "Array", "Boolean", "Date", "Error", "EvalError", "Function", "Infinity", "JSON", "Math", "NaN", "Number", "Object", "RangeError", "ReferenceError", "RegExp", "String", "SyntaxError", "TypeError", "URIError", "decodeURI", "decodeURIComponent", "encodeURI", "encodeURIComponent", "escape", "eval", "isFinite", "isNaN", "parseFloat", "parseInt", "undefined", "unescape" ]; function Context() {} Context.prototype = {}; var Script = exports.Script = function t(e) { if (!(this instanceof Script)) return new Script(e); this.code = e; }; Script.prototype.runInContext = function(t) { if (!(t instanceof Context)) { throw new TypeError("needs a 'context' argument."); } var e = document.createElement("iframe"); if (!e.style) e.style = {}; e.style.display = "none"; document.body.appendChild(e); var r = e.contentWindow; var n = r.eval, i = r.execScript; if (!n && i) { i.call(r, "null"); n = r.eval; } forEach(Object_keys(t), (function(e) { r[e] = t[e]; })); forEach(globals, (function(e) { if (t[e]) { r[e] = t[e]; } })); var o = Object_keys(r); var s = n.call(r, this.code); forEach(Object_keys(r), (function(e) { if (e in t || indexOf(o, e) === -1) { t[e] = r[e]; } })); forEach(globals, (function(e) { if (!(e in t)) { defineProp(t, e, r[e]); } })); document.body.removeChild(e); return s; }; Script.prototype.runInThisContext = function() { return eval(this.code); }; Script.prototype.runInNewContext = function(t) { var e = Script.createContext(t); var r = this.runInContext(e); if (t) { forEach(Object_keys(e), (function(r) { t[r] = e[r]; })); } return r; }; forEach(Object_keys(Script.prototype), (function(t) { exports[t] = Script[t] = function(e) { var r = Script(e); return r[t].apply(r, [].slice.call(arguments, 1)); }; })); exports.isContext = function(t) { return t instanceof Context; }; exports.createScript = function(t) { return exports.Script(t); }; exports.createContext = Script.createContext = function(t) { var e = new Context; if (typeof t === "object") { forEach(Object_keys(t), (function(r) { e[r] = t[r]; })); } return e; }; } }; if (typeof __nccwpck_require__ !== "undefined") __nccwpck_require__.ab = __dirname + "/"; var __webpack_exports__ = {}; __webpack_modules__[965](0, __webpack_exports__); module.exports = __webpack_exports__; })(); }), 4375: (function(t, e, r) { let n; t.exports = typeof queueMicrotask === 'function' ? queueMicrotask.bind(typeof window !== 'undefined' ? window : r.g) : (t)=>(n || (n = Promise.resolve())).then(t).catch((t)=>setTimeout(()=>{ throw t; }, 0)); }), 9180: (function(t, e, r) { window.global = window; r.g.fetch = window.fetch; t.exports.Buffer = r(8764).Buffer; }), 497: (function(t, e, r) { e.wasm2json = r(3195); e.json2wasm = r(4747); e.text2json = r(9837); e.Iterator = r(3804); }), 3804: (function(t, e, r) { const n = (r(1415).Buffer); const i = (r(5548).unsigned); const o = r(3195); const s = r(825); const a = [ 'custom', 'type', 'import', 'function', 'table', 'memory', 'global', 'export', 'start', 'element', 'code', 'data' ]; t.exports = class t { constructor(t){ this._wasm = t; this._sections = []; this._modified = false; } get wasm() { if (this._modified) { this._wasm = n.concat(this._sections.concat(this._pipe.buffer)); this._modified = false; } return this._wasm; } *[Symbol.iterator]() { this._pipe = new s(this._wasm); this._sections = [ this._pipe.read(8) ]; while(!this._pipe.end){ const t = this._pipe.bytesRead; const e = this._pipe.read(1)[0]; const r = Number(i.read(this._pipe)); const n = this._pipe.read(r); const o = this._pipe.bytesRead; const a = this._wasm.slice(t, o); const u = this._sections.push(a) - 1; yield new f(e, n, this, u); } } _update(t, e) { this._modified = true; this._sections[t] = e; } }; class f { constructor(t, e, r, n){ this._it = r; this._index = n; this.type = a[t]; this._type = t; this._section = e; const o = new s(e); if (this.type !== 'custom') { this.count = Number(i.read(o)); } this._body = o.buffer; } toJSON() { return o.sectionParsers[this.type](new s(this._section)); } appendEntries(t) { this.count += t.length; this._body = n.concat([ this._body ].concat(t)); const e = n.concat([ i.encode(this.count), this._body ]); this._it._update(this._index, n.concat([ n.from([ this._type ]), i.encode(e.length), e ])); } } }), 4747: (function(t, e, r) { const n = (r(1415).Buffer); const i = r(5548); const o = r(825); const s = r(8575); const a = (t.exports = (t)=>{ return a.generate(t).buffer; }); const f = (a.LANGUAGE_TYPES = { i32: 0x7f, i64: 0x7e, f32: 0x7d, f64: 0x7c, anyFunc: 0x70, func: 0x60, block_type: 0x40 }); const u = (a.EXTERNAL_KIND = { function: 0, table: 1, memory: 2, global: 3 }); const c = (a.SECTION_IDS = { custom: 0, type: 1, import: 2, function: 3, table: 4, memory: 5, global: 6, export: 7, start: 8, element: 9, code: 10, data: 11 }); const l = (a.OPCODES = { unreachable: 0x0, nop: 0x1, block: 0x2, loop: 0x3, if: 0x4, else: 0x5, end: 0xb, br: 0xc, br_if: 0xd, br_table: 0xe, return: 0xf, call: 0x10, call_indirect: 0x11, drop: 0x1a, select: 0x1b, get_local: 0x20, set_local: 0x21, tee_local: 0x22, get_global: 0x23, set_global: 0x24, 'i32.load': 0x28, 'i64.load': 0x29, 'f32.load': 0x2a, 'f64.load': 0x2b, 'i32.load8_s': 0x2c, 'i32.load8_u': 0x2d, 'i32.load16_s': 0x2e, 'i32.load16_u': 0x2f, 'i64.load8_s': 0x30, 'i64.load8_u': 0x31, 'i64.load16_s': 0x32, 'i64.load16_u': 0x33, 'i64.load32_s': 0x34, 'i64.load32_u': 0x35, 'i32.store': 0x36, 'i64.store': 0x37, 'f32.store': 0x38, 'f64.store': 0x39, 'i32.store8': 0x3a, 'i32.store16': 0x3b, 'i64.store8': 0x3c, 'i64.store16': 0x3d, 'i64.store32': 0x3e, current_memory: 0x3f, grow_memory: 0x40, 'i32.const': 0x41, 'i64.const': 0x42, 'f32.const': 0x43, 'f64.const': 0x44, 'i32.eqz': 0x45, 'i32.eq': 0x46, 'i32.ne': 0x47, 'i32.lt_s': 0x48, 'i32.lt_u': 0x49, 'i32.gt_s': 0x4a, 'i32.gt_u': 0x4b, 'i32.le_s': 0x4c, 'i32.le_u': 0x4d, 'i32.ge_s': 0x4e, 'i32.ge_u': 0x4f, 'i64.eqz': 0x50, 'i64.eq': 0x51, 'i64.ne': 0x52, 'i64.lt_s': 0x53, 'i64.lt_u': 0x54, 'i64.gt_s': 0x55, 'i64.gt_u': 0x56, 'i64.le_s': 0x57, 'i64.le_u': 0x58, 'i64.ge_s': 0x59, 'i64.ge_u': 0x5a, 'f32.eq': 0x5b, 'f32.ne': 0x5c, 'f32.lt': 0x5d, 'f32.gt': 0x5e, 'f32.le': 0x5f, 'f32.ge': 0x60, 'f64.eq': 0x61, 'f64.ne': 0x62, 'f64.lt': 0x63, 'f64.gt': 0x64, 'f64.le': 0x65, 'f64.ge': 0x66, 'i32.clz': 0x67, 'i32.ctz': 0x68, 'i32.popcnt': 0x69, 'i32.add': 0x6a, 'i32.sub': 0x6b, 'i32.mul': 0x6c, 'i32.div_s': 0x6d, 'i32.div_u': 0x6e, 'i32.rem_s': 0x6f, 'i32.rem_u': 0x70, 'i32.and': 0x71, 'i32.or': 0x72, 'i32.xor': 0x73, 'i32.shl': 0x74, 'i32.shr_s': 0x75, 'i32.shr_u': 0x76, 'i32.rotl': 0x77, 'i32.rotr': 0x78, 'i64.clz': 0x79, 'i64.ctz': 0x7a, 'i64.popcnt': 0x7b, 'i64.add': 0x7c, 'i64.sub': 0x7d, 'i64.mul': 0x7e, 'i64.div_s': 0x7f, 'i64.div_u': 0x80, 'i64.rem_s': 0x81, 'i64.rem_u': 0x82, 'i64.and': 0x83, 'i64.or': 0x84, 'i64.xor': 0x85, 'i64.shl': 0x86, 'i64.shr_s': 0x87, 'i64.shr_u': 0x88, 'i64.rotl': 0x89, 'i64.rotr': 0x8a, 'f32.abs': 0x8b, 'f32.neg': 0x8c, 'f32.ceil': 0x8d, 'f32.floor': 0x8e, 'f32.trunc': 0x8f, 'f32.nearest': 0x90, 'f32.sqrt': 0x91, 'f32.add': 0x92, 'f32.sub': 0x93, 'f32.mul': 0x94, 'f32.div': 0x95, 'f32.min': 0x96, 'f32.max': 0x97, 'f32.copysign': 0x98, 'f64.abs': 0x99, 'f64.neg': 0x9a, 'f64.ceil': 0x9b, 'f64.floor': 0x9c, 'f64.trunc': 0x9d, 'f64.nearest': 0x9e, 'f64.sqrt': 0x9f, 'f64.add': 0xa0, 'f64.sub': 0xa1, 'f64.mul': 0xa2, 'f64.div': 0xa3, 'f64.min': 0xa4, 'f64.max': 0xa5, 'f64.copysign': 0xa6, 'i32.wrap/i64': 0xa7, 'i32.trunc_s/f32': 0xa8, 'i32.trunc_u/f32': 0xa9, 'i32.trunc_s/f64': 0xaa, 'i32.trunc_u/f64': 0xab, 'i64.extend_s/i32': 0xac, 'i64.extend_u/i32': 0xad, 'i64.trunc_s/f32': 0xae, 'i64.trunc_u/f32': 0xaf, 'i64.trunc_s/f64': 0xb0, 'i64.trunc_u/f64': 0xb1, 'f32.convert_s/i32': 0xb2, 'f32.convert_u/i32': 0xb3, 'f32.convert_s/i64': 0xb4, 'f32.convert_u/i64': 0xb5, 'f32.demote/f64': 0xb6, 'f64.convert_s/i32': 0xb7, 'f64.convert_u/i32': 0xb8, 'f64.convert_s/i64': 0xb9, 'f64.convert_u/i64': 0xba, 'f64.promote/f32': 0xbb, 'i32.reinterpret/f32': 0xbc, 'i64.reinterpret/f64': 0xbd, 'f32.reinterpret/i32': 0xbe, 'f64.reinterpret/i64': 0xbf }); a.typeGenerators = { function: (t, e)=>{ i.unsigned.write(t, e); }, table: (t, e)=>{ e.write([ f[t.elementType] ]); a.typeGenerators.memory(t.limits, e); }, global: (t, e)=>{ e.write([ f[t.contentType] ]); e.write([ t.mutability ]); }, memory: (t, e)=>{ i.unsigned.write(Number(t.maximum !== undefined), e); i.unsigned.write(t.intial, e); if (t.maximum !== undefined) { i.unsigned.write(t.maximum, e); } }, initExpr: (t, e)=>{ a.generateOp(t, e); a.generateOp({ name: 'end', type: 'void' }, e); } }; a.immediataryGenerators = { varuint1: (t, e)=>{ e.write([ t ]); return e; }, varuint32: (t, e)=>{ i.unsigned.write(t, e); return e; }, varint32: (t, e)=>{ i.signed.write(t, e); return e; }, varint64: (t, e)=>{ i.signed.write(t, e); return e; }, uint32: (t, e)=>{ e.write(t); return e; }, uint64: (t, e)=>{ e.write(t); return e; }, block_type: (t, e)=>{ e.write([ f[t] ]); return e; }, br_table: (t, e)=>{ i.unsigned.write(t.targets.length, e); for (let r of t.targets){ i.unsigned.write(r, e); } i.unsigned.write(t.defaultTarget, e); return e; }, call_indirect: (t, e)=>{ i.unsigned.write(t.index, e); e.write([ t.reserved ]); return e; }, memory_immediate: (t, e)=>{ i.unsigned.write(t.flags, e); i.unsigned.write(t.offset, e); return e; } }; const h = { type: (t, e = new o())=>{ e.write([ f[t.form] ]); const r = t.params.length; i.unsigned.write(r, e); if (r !== 0) { e.write(t.params.map((t)=>f[t])); } e.write([ t.return_type ? 1 : 0 ]); if (t.return_type) { e.write([ f[t.return_type] ]); } return e.buffer; }, import: (t, e = new o())=>{ i.unsigned.write(t.moduleStr.length, e); e.write(t.moduleStr); i.unsigned.write(t.fieldStr.length, e); e.write(t.fieldStr); e.write([ u[t.kind] ]); a.typeGenerators[t.kind](t.type, e); }, function: (t, e = new o())=>{ i.unsigned.write(t, e); return e.buffer; }, table: a.typeGenerators.table, global: (t, e = new o())=>{ a.typeGenerators.global(t.type, e); a.typeGenerators.initExpr(t.init, e); return e; }, memory: a.typeGenerators.memory, export: (t, e = new o())=>{ const r = n.from(t.field_str); const s = r.length; i.unsigned.write(s, e); e.write(r); e.write([ u[t.kind] ]); i.unsigned.write(t.index, e); return e; }, element: (t, e = new o())=>{ i.unsigned.write(t.index, e); a.typeGenerators.initExpr(t.offset, e); i.unsigned.write(t.elements.length, e); for (let r of t.elements){ i.unsigned.write(r, e); } return e; }, code: (t, e = new o())=>{ let r = new o(); i.unsigned.write(t.locals.length, r); for (let n of t.locals){ i.unsigned.write(n.count, r); r.write([ f[n.type] ]); } for (let s of t.code){ a.generateOp(s, r); } i.unsigned.write(r.bytesWrote, e); e.write(r.buffer); return e; }, data: (t, e = new o())=>{ i.unsigned.write(t.index, e); a.typeGenerators.initExpr(t.offset, e); i.unsigned.write(t.data.length, e); e.write(t.data); return e; } }; a.entryGenerators = h; a.generateSection = function(t, e = new o()) { const r = t.name; const n = new o(); e.write([ c[r] ]); if (r === 'custom') { i.unsigned.write(t.sectionName.length, n); n.write(t.sectionName); n.write(t.payload); } else if (r === 'start') { i.unsigned.write(t.index, n); } else { i.unsigned.write(t.entries.length, n); for (let s of t.entries){ h[r](s, n); } } i.unsigned.write(n.bytesWrote, e); e.write(n.buffer); return e; }; a.generate = (t, e = new o())=>{ const [r, ...n] = t; a.generatePreramble(r, e); for (let i of n){ a.generateSection(i, e); } return e; }; a.generatePreramble = (t, e = new o())=>{ e.write(t.magic); e.write(t.version); return e; }; a.generateOp = (t, e = new o())=>{ let r = t.name; if (t.return_type !== undefined) { r = t.return_type + '.' + r; } e.write([ l[r] ]); const n = s[t.name === 'const' ? t.return_type : t.name]; if (n) { a.immediataryGenerators[n](t.immediates, e); } return e; }; }), 825: (function(t, e, r) { const n = (r(9509).Buffer); t.exports = class t { constructor(t = n.from([])){ this.buffer = t; this._bytesRead = 0; this._bytesWrote = 0; } read(t) { this._bytesRead += t; const e = this.buffer.slice(0, t); this.buffer = this.buffer.slice(t); return e; } write(t) { t = n.from(t); this._bytesWrote += t.length; this.buffer = n.concat([ this.buffer, t ]); } get end() { return !this.buffer.length; } get bytesRead() { return this._bytesRead; } get bytesWrote() { return this._bytesWrote; } }; }), 1415: (function(t, e, r) { r.g.fetch = window.fetch; r(8764).Buffer; }), 9837: (function(t, e, r) { const n = r(8575); t.exports = (t)=>{ const e = []; const r = t.split(/\s|\n/); while(r.length){ const o = r.shift(); const s = {}; let [a, f] = o.split('.'); if (f === undefined) { f = a; } else { s.return_type = a; } s.name = f; const u = n[s.name === 'const' ? s.return_type : s.name]; if (u) { s.immediates = i(u, r); } e.push(s); } return e; }; function i(t, e) { const r = {}; switch(t){ case 'br_table': const n = []; while(1){ let i = e[0]; if (isNaN(i)) break; e.shift(); n.push(i); } return n; case 'call_indirect': r.index = e.shift(); r.reserved = 0; return r; case 'memory_immediate': r.flags = e.shift(); r.offset = e.shift(); return r; default: return e.shift(); } } }), 3195: (function(t, e, r) { var n = r(8764)["Buffer"]; const i = r(5548); const o = r(825); const s = r(8575); const a = t.exports = (t, e)=>{ const r = new o(t); return a.parse(r, e); }; const f = a.LANGUAGE_TYPES = { 0x7f: 'i32', 0x7e: 'i64', 0x7d: 'f32', 0x7c: 'f64', 0x70: 'anyFunc', 0x60: 'func', 0x40: 'block_type' }; const u = a.EXTERNAL_KIND = { 0: 'function', 1: 'table', 2: 'memory', 3: 'global' }; a.parsePreramble = (t)=>{ const e = {}; e.name = 'preramble'; e.magic = [ ...t.read(4) ]; e.version = [ ...t.read(4) ]; return e; }; a.parseSectionHeader = (t)=>{ const e = t.read(1)[0]; const r = i.unsigned.readBn(t).toNumber(); return { id: e, name: l[e], size: r }; }; const c = a.OPCODES = { 0x0: 'unreachable', 0x1: 'nop', 0x2: 'block', 0x3: 'loop', 0x4: 'if', 0x5: 'else', 0xb: 'end', 0xc: 'br', 0xd: 'br_if', 0xe: 'br_table', 0xf: 'return', 0x10: 'call', 0x11: 'call_indirect', 0x1a: 'drop', 0x1b: 'select', 0x20: 'get_local', 0x21: 'set_local', 0x22: 'tee_local', 0x23: 'get_global', 0x24: 'set_global', 0x28: 'i32.load', 0x29: 'i64.load', 0x2a: 'f32.load', 0x2b: 'f64.load', 0x2c: 'i32.load8_s', 0x2d: 'i32.load8_u', 0x2e: 'i32.load16_s', 0x2f: 'i32.load16_u', 0x30: 'i64.load8_s', 0x31: 'i64.load8_u', 0x32: 'i64.load16_s', 0x33: 'i64.load16_u', 0x34: 'i64.load32_s', 0x35: 'i64.load32_u', 0x36: 'i32.store', 0x37: 'i64.store', 0x38: 'f32.store', 0x39: 'f64.store', 0x3a: 'i32.store8', 0x3b: 'i32.store16', 0x3c: 'i64.store8', 0x3d: 'i64.store16', 0x3e: 'i64.store32', 0x3f: 'current_memory', 0x40: 'grow_memory', 0x41: 'i32.const', 0x42: 'i64.const', 0x43: 'f32.const', 0x44: 'f64.const', 0x45: 'i32.eqz', 0x46: 'i32.eq', 0x47: 'i32.ne', 0x48: 'i32.lt_s', 0x49: 'i32.lt_u', 0x4a: 'i32.gt_s', 0x4b: 'i32.gt_u', 0x4c: 'i32.le_s', 0x4d: 'i32.le_u', 0x4e: 'i32.ge_s', 0x4f: 'i32.ge_u', 0x50: 'i64.eqz', 0x51: 'i64.eq', 0x52: 'i64.ne', 0x53: 'i64.lt_s', 0x54: 'i64.lt_u', 0x55: 'i64.gt_s', 0x56: 'i64.gt_u', 0x57: 'i64.le_s', 0x58: 'i64.le_u', 0x59: 'i64.ge_s', 0x5a: 'i64.ge_u', 0x5b: 'f32.eq', 0x5c: 'f32.ne', 0x5d: 'f32.lt', 0x5e: 'f32.gt', 0x5f: 'f32.le', 0x60: 'f32.ge', 0x61: 'f64.eq', 0x62: 'f64.ne', 0x63: 'f64.lt', 0x64: 'f64.gt', 0x65: 'f64.le', 0x66: 'f64.ge', 0x67: 'i32.clz', 0x68: 'i32.ctz', 0x69: 'i32.popcnt', 0x6a: 'i32.add', 0x6b: 'i32.sub', 0x6c: 'i32.mul', 0x6d: 'i32.div_s', 0x6e: 'i32.div_u', 0x6f: 'i32.rem_s', 0x70: 'i32.rem_u', 0x71: 'i32.and', 0x72: 'i32.or', 0x73: 'i32.xor', 0x74: 'i32.shl', 0x75: 'i32.shr_s', 0x76: 'i32.shr_u', 0x77: 'i32.rotl', 0x78: 'i32.rotr', 0x79: 'i64.clz', 0x7a: 'i64.ctz', 0x7b: 'i64.popcnt', 0x7c: 'i64.add', 0x7d: 'i64.sub', 0x7e: 'i64.mul', 0x7f: 'i64.div_s', 0x80: 'i64.div_u', 0x81: 'i64.rem_s', 0x82: 'i64.rem_u', 0x83: 'i64.and', 0x84: 'i64.or', 0x85: 'i64.xor', 0x86: 'i64.shl', 0x87: 'i64.shr_s', 0x88: 'i64.shr_u', 0x89: 'i64.rotl', 0x8a: 'i64.rotr', 0x8b: 'f32.abs', 0x8c: 'f32.neg', 0x8d: 'f32.ceil', 0x8e: 'f32.floor', 0x8f: 'f32.trunc', 0x90: 'f32.nearest', 0x91: 'f32.sqrt', 0x92: 'f32.add', 0x93: 'f32.sub', 0x94: 'f32.mul', 0x95: 'f32.div', 0x96: 'f32.min', 0x97: 'f32.max', 0x98: 'f32.copysign', 0x99: 'f64.abs', 0x9a: 'f64.neg', 0x9b: 'f64.ceil', 0x9c: 'f64.floor', 0x9d: 'f64.trunc', 0x9e: 'f64.nearest', 0x9f: 'f64.sqrt', 0xa0: 'f64.add', 0xa1: 'f64.sub', 0xa2: 'f64.mul', 0xa3: 'f64.div', 0xa4: 'f64.min', 0xa5: 'f64.max', 0xa6: 'f64.copysign', 0xa7: 'i32.wrap/i64', 0xa8: 'i32.trunc_s/f32', 0xa9: 'i32.trunc_u/f32', 0xaa: 'i32.trunc_s/f64', 0xab: 'i32.trunc_u/f64', 0xac: 'i64.extend_s/i32', 0xad: 'i64.extend_u/i32', 0xae: 'i64.trunc_s/f32', 0xaf: 'i64.trunc_u/f32', 0xb0: 'i64.trunc_s/f64', 0xb1: 'i64.trunc_u/f64', 0xb2: 'f32.convert_s/i32', 0xb3: 'f32.convert_u/i32', 0xb4: 'f32.convert_s/i64', 0xb5: 'f32.convert_u/i64', 0xb6: 'f32.demote/f64', 0xb7: 'f64.convert_s/i32', 0xb8: 'f64.convert_u/i32', 0xb9: 'f64.convert_s/i64', 0xba: 'f64.convert_u/i64', 0xbb: 'f64.promote/f32', 0xbc: 'i32.reinterpret/f32', 0xbd: 'i64.reinterpret/f64', 0xbe: 'f32.reinterpret/i32', 0xbf: 'f64.reinterpret/i64' }; const l = a.SECTION_IDS = { 0: 'custom', 1: 'type', 2: 'import', 3: 'function', 4: 'table', 5: 'memory', 6: 'global', 7: 'export', 8: 'start', 9: 'element', 10: 'code', 11: 'data' }; a.immediataryParsers = { 'varuint1': (t)=>{ const e = t.read(1)[0]; return e; }, 'varuint32': (t)=>{ const e = i.unsigned.read(t); return e; }, 'varint32': (t)=>{ const e = i.signed.read(t); return e; }, 'varint64': (t)=>{ const e = i.signed.read(t); return e; }, 'uint32': (t)=>{ return [ ...t.read(4) ]; }, 'uint64': (t)=>{ return [ ...t.read(8) ]; }, 'block_type': (t)=>{ const e = t.read(1)[0]; return f[e]; }, 'br_table': (t)=>{ const e = { targets: [] }; const r = i.unsigned.readBn(t).toNumber(); for(let n = 0; n < r; n++){ const o = i.unsigned.readBn(t).toNumber(); e.targets.push(o); } e.defaultTarget = i.unsigned.readBn(t).toNumber(); return e; }, 'call_indirect': (t)=>{ const e = {}; e.index = i.unsigned.readBn(t).toNumber(); e.reserved = t.read(1)[0]; return e; }, 'memory_immediate': (t)=>{ const e = {}; e.flags = i.unsigned.readBn(t).toNumber(); e.offset = i.unsigned.readBn(t).toNumber(); return e; } }; a.typeParsers = { 'function': (t)=>{ return i.unsigned.readBn(t).toNumber(); }, table: (t)=>{ const e = {}; const r = t.read(1)[0]; e.elementType = f[r]; e.limits = a.typeParsers.memory(t); return e; }, global: (t)=>{ const e = {}; let r = t.read(1)[0]; e.contentType = f[r]; e.mutability = t.read(1)[0]; return e; }, memory: (t)=>{ const e = {}; e.flags = i.unsigned.readBn(t).toNumber(); e.intial = i.unsigned.readBn(t).toNumber(); if (e.flags === 1) { e.maximum = i.unsigned.readBn(t).toNumber(); } return e; }, initExpr: (t)=>{ const e = a.parseOp(t); t.read(1); return e; } }; const h = a.sectionParsers = { 'custom': (t, e)=>{ const r = { name: 'custom' }; const s = new o(t.read(e.size)); const a = i.unsigned.readBn(s).toNumber(); const f = s.read(a); r.sectionName = n.from(f).toString(); r.payload = [ ...s.buffer ]; return r; }, 'type': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'type', entries: [] }; for(let n = 0; n < e; n++){ let o = t.read(1)[0]; const s = { form: f[o], params: [] }; const a = i.unsigned.readBn(t).toNumber(); for(let u = 0; u < a; u++){ const c = t.read(1)[0]; s.params.push(f[c]); } const l = i.unsigned.readBn(t).toNumber(); if (l) { o = t.read(1)[0]; s.return_type = f[o]; } r.entries.push(s); } return r; }, 'import': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'import', entries: [] }; for(let o = 0; o < e; o++){ const s = {}; const f = i.unsigned.readBn(t).toNumber(); s.moduleStr = n.from(t.read(f)).toString(); const c = i.unsigned.readBn(t).toNumber(); s.fieldStr = n.from(t.read(c)).toString(); const l = t.read(1)[0]; s.kind = u[l]; s.type = a.typeParsers[s.kind](t); r.entries.push(s); } return r; }, 'function': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'function', entries: [] }; for(let n = 0; n < e; n++){ const o = i.unsigned.readBn(t).toNumber(); r.entries.push(o); } return r; }, 'table': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'table', entries: [] }; for(let n = 0; n < e; n++){ const o = a.typeParsers.table(t); r.entries.push(o); } return r; }, 'memory': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'memory', entries: [] }; for(let n = 0; n < e; n++){ const o = a.typeParsers.memory(t); r.entries.push(o); } return r; }, 'global': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'global', entries: [] }; for(let n = 0; n < e; n++){ const o = {}; o.type = a.typeParsers.global(t); o.init = a.typeParsers.initExpr(t); r.entries.push(o); } return r; }, 'export': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'export', entries: [] }; for(let o = 0; o < e; o++){ const s = i.unsigned.readBn(t).toNumber(); const a = {}; a.field_str = n.from(t.read(s)).toString(); const f = t.read(1)[0]; a.kind = u[f]; a.index = i.unsigned.readBn(t).toNumber(); r.entries.push(a); } return r; }, 'start': (t)=>{ const e = { name: 'start' }; e.index = i.unsigned.readBn(t).toNumber(); return e; }, 'element': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'element', entries: [] }; for(let n = 0; n < e; n++){ const o = { elements: [] }; o.index = i.unsigned.readBn(t).toNumber(); o.offset = a.typeParsers.initExpr(t); const s = i.unsigned.readBn(t).toNumber(); for(let f = 0; f < s; f++){ const u = i.unsigned.readBn(t).toNumber(); o.elements.push(u); } r.entries.push(o); } return r; }, 'code': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'code', entries: [] }; for(let n = 0; n < e; n++){ const o = { locals: [], code: [] }; let s = i.unsigned.readBn(t).toNumber(); const u = t.bytesRead + s; const c = i.unsigned.readBn(t).toNumber(); for(let l = 0; l < c; l++){ const h = {}; h.count = i.unsigned.readBn(t).toNumber(); const d = t.read(1)[0]; h.type = f[d]; o.locals.push(h); } while(t.bytesRead < u){ const p = a.parseOp(t); o.code.push(p); } r.entries.push(o); } return r; }, 'data': (t)=>{ const e = i.unsigned.readBn(t).toNumber(); const r = { name: 'data', entries: [] }; for(let n = 0; n < e; n++){ const o = {}; o.index = i.unsigned.readBn(t).toNumber(); o.offset = a.typeParsers.initExpr(t); const s = i.unsigned.readBn(t).toNumber(); o.data = [ ...t.read(s) ]; r.entries.push(o); } return r; } }; a.parseOp = (t)=>{ const e = {}; const r = t.read(1)[0]; const n = c[r]; let [i, o] = n.split('.'); if (o === undefined) { o = i; } else { e.return_type = i; } e.name = o; const f = s[o === 'const' ? i : o]; if (f) { e.immediates = a.immediataryParsers[f](t); } return e; }; a.parse = (t, e)=>{ const r = a.parsePreramble(t); const n = [ r ]; while(!t.end){ const i = a.parseSectionHeader(t); n.push(h[i.name](t, i)); } return n; }; }), 8060: (function(t, e, r) { const n = r(497); const i = n.text2json; const o = (r(4747).SECTION_IDS); const s = r(5936); function a(t, e = {}, r = 0) { let n = 0; r = e['DEFAULT'] !== undefined ? e['DEFAULT'] : 0; if (Array.isArray(t)) { t.forEach((t)=>{ n += a(t, e); }); } else if (typeof t === 'object') { for(const i in t){ const o = e[i]; if (o) { n += a(t[i], o, r); } } } else if (e[t] === undefined) { n = r; } else { n = e[t]; } return n; } function f(t, e, r, n, o) { function s(t, e) { return i(`${n}.const ${t} call ${e}`); } function f(t, e) { if (t.name === 'call' && t.immediates >= e) { t.immediates = (++t.immediates).toString(); } } function u() { const t = s(0, 0); return t.reduce((t, r)=>t + a(r.name, e.code), 0); } const c = new Set([ 'grow_memory', 'end', 'br', 'br_table', 'br_if', 'if', 'else', 'return', 'loop' ]); const l = u(); let h = t.code.slice(); let d = []; o += a(t.locals, e.local); while(h.length){ let p = 0; while(true){ const g = h[p++]; f(g, r); o += a(g.name, e.code); if (c.has(g.name)) { break; } } if (o !== 0) { o += l; d = d.concat(s(o, r)); } d = d.concat(h.slice(0, p)); h = h.slice(p); o = 0; } t.code = d; return t; } e.meterJSON = (t, e)=>{ function r(t, e) { return t.find((t)=>t.name === e); } function n(t, e) { const r = o[e]; for(let n in t){ const i = t[n]; const s = o[i.name]; if (s) { if (r < s) { t.splice(n, 0, { name: e, entries: [] }); return; } } } } let i = 0; let u, c; let { costTable: l , moduleStr: h , fieldStr: d , meterType: p } = e; if (!l) l = s; if (!h) h = 'metering'; if (!d) d = 'usegas'; if (!p) p = 'i32'; if (!r(t, 'type')) n(t, 'type'); if (!r(t, 'import')) n(t, 'import'); const g = { moduleStr: h, fieldStr: d, kind: 'function' }; const b = { form: 'func', params: [ p ] }; t = t.slice(0); for (let v of t){ v = Object.assign(v); switch(v.name){ case 'type': g.type = v.entries.push(b) - 1; c = v; break; case 'function': u = v; break; case 'import': for (const y of v.entries){ if (y.moduleStr === h && y.fieldStr === d) { throw new Error('importing metering function is not allowed'); } if (y.kind === 'function') { i++; } } v.entries.push(g); break; case 'export': for (const m of v.entries){ if (m.kind === 'function' && m.index >= i) { m.index++; } } break; case 'element': for (const w of v.entries){ w.elements = w.elements.map((t)=>t >= i ? ++t : t); } break; case 'start': if (v.index >= i) v.index++; break; case 'code': for(const _ in v.entries){ const S = v.entries[_]; const E = u.entries[_]; const x = c.entries[E]; const M = a(x, l.type); f(S, l.code, i, p, M); } break; } } return t; }; e.meterWASM = (t, r = {})=>{ let i = n.wasm2json(t); i = e.meterJSON(i, r); return n.json2wasm(i); }; }), 9967: (function(t, e, r) { t.exports = i; const n = r(4375); function i(t, e, r) { if (typeof e !== 'number') throw new Error('second argument must be a Number'); let i, o, s, a, f; let u = true; let c; if (Array.isArray(t)) { i = []; s = o = t.length; } else { a = Object.keys(t); i = {}; s = o = a.length; } function l(t) { function e() { if (r) r(t, i); r = null; } if (u) n(e); else e(); } function h(e, r, n) { i[e] = n; if (r) f = true; if (--s === 0 || r) { l(r); } else if (!f && c < o) { let u; if (a) { u = a[c]; c += 1; t[u](function(t, e) { h(u, t, e); }); } else { u = c; c += 1; t[u](function(t, e) { h(u, t, e); }); } } } c = e; if (!s) { l(null); } else if (a) { a.some(function(r, n) { t[r](function(t, e) { h(r, t, e); }); if (n === e - 1) return true; return false; }); } else { t.some(function(t, r) { t(function(t, e) { h(r, t, e); }); if (r === e - 1) return true; return false; }); } u = false; } }), 9509: (function(t, e, r) { var n = r(8764); var i = n.Buffer; function o(t, e) { for(var r in t){ e[r] = t[r]; } } if (i.from && i.alloc && i.allocUnsafe && i.allocUnsafeSlow) { t.exports = n; } else { o(n, e); e.Buffer = s; } function s(t, e, r) { return i(t, e, r); } s.prototype = Object.create(i.prototype); o(i, s); s.from = function(t, e, r) { if (typeof t === 'number') { throw new TypeError('Argument must not be a number'); } return i(t, e, r); }; s.alloc = function(t, e, r) { if (typeof t !== 'number') { throw new TypeError('Argument must be a number'); } var n = i(t); if (e !== undefined) { if (typeof r === 'string') { n.fill(e, r); } else { n.fill(e); } } else { n.fill(0); } return n; }; s.allocUnsafe = function(t) { if (typeof t !== 'number') { throw new TypeError('Argument must be a number'); } return i(t); }; s.allocUnsafeSlow = function(t) { if (typeof t !== 'number') { throw new TypeError('Argument must be a number'); } return n.SlowBuffer(t); }; }), 7668: (function(t, e) { "use strict"; const r = v(); r.configure = v; r.stringify = r; r.default = r; e.stringify = r; e.configure = v; t.exports = r; const n = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/; const i = /[\u0000-\u001f\u0022\u005c\ud800-\udfff]|[\ud800-\udbff](?![\udc00-\udfff])|(?:[^\ud800-\udbff]|^)[\udc00-\udfff]/g; const o = [ '\\u0000', '\\u0001', '\\u0002', '\\u0003', '\\u0004', '\\u0005', '\\u0006', '\\u0007', '\\b', '\\t', '\\n', '\\u000b', '\\f', '\\r', '\\u000e', '\\u000f', '\\u0010', '\\u0011', '\\u0012', '\\u0013', '\\u0014', '\\u0015', '\\u0016', '\\u0017', '\\u0018', '\\u0019', '\\u001a', '\\u001b', '\\u001c', '\\u001d', '\\u001e', '\\u001f', '', '', '\\"', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '\\\\' ]; function s(t) { if (t.length === 2) { const e = t.charCodeAt(1); return `${t[0]}\\u${e.toString(16)}`; } const r = t.charCodeAt(0); return o.length > r ? o[r] : `\\u${r.toString(16)}`; } function a(t) { if (t.length < 5000 && !n.test(t)) { return t; } if (t.length > 100) { return t.replace(i, s); } let e = ''; let r = 0; for(let a = 0; a < t.length; a++){ const f = t.charCodeAt(a); if (f === 34 || f === 92 || f < 32) { e += `${t.slice(r, a)}${o[f]}`; r = a + 1; } else if (f >= 0xd800 && f <= 0xdfff) { if (f <= 0xdbff && a + 1 < t.length) { const u = t.charCodeAt(a + 1); if (u >= 0xdc00 && u <= 0xdfff) { a++; continue; } } e += `${t.slice(r, a)}${`\\u${f.toString(16)}`}`; r = a + 1; } } e += t.slice(r); return e; } function f(t) { if (t.length > 2e2) { return t.sort(); } for(let e = 1; e < t.length; e++){ const r = t[e]; let n = e; while(n !== 0 && t[n - 1] > r){ t[n] = t[n - 1]; n--; } t[n] = r; } return t; } const u = Object.getOwnPropertyDescriptor(Object.getPrototypeOf(Object.getPrototypeOf(new Uint8Array())), Symbol.toStringTag).get; function c(t) { return u.call(t) !== undefined && t.length !== 0; } function l(t, e, r) { if (t.length < r) { r = t.length; } const n = e === ',' ? '' : ' '; let i = `"0":${n}${t[0]}`; for(let o = 1; o < r; o++){ i += `${e}"${o}":${n}${t[o]}`; } return i; } function h(t) { if (t && Object.prototype.hasOwnProperty.call(t, 'circularValue')) { var e = t.circularValue; if (typeof e === 'string') { return `"${e}"`; } if (e == null) { return e; } if (e === Error || e === TypeError) { return { toString () { throw new TypeError('Converting circular structure to JSON'); } }; } throw new TypeError('The "circularValue" argument must be of type string or the value null or undefined'); } return '"[Circular]"'; } function d(t, e) { if (t && Object.prototype.hasOwnProperty.call(t, e)) { var r = t[e]; if (typeof r !== 'boolean') { throw new TypeError(`The "${e}" argument must be of type boolean`); } } return r === undefined ? true : r; } function p(t, e) { if (t && Object.prototype.hasOwnProperty.call(t, e)) { var r = t[e]; if (typeof r !== 'number') { throw new TypeError(`The "${e}" argument must be of type number`); } if (!Number.isInteger(r)) { throw new TypeError(`The "${e}" argument must be an integer`); } if (r < 1) { throw new RangeError(`The "${e}" argument must be >= 1`); } } return r === undefined ? Infinity : r; } function g(t) { if (t === 1) { return '1 item'; } return `${t} items`; } function b(t) { const e = new Set(); for (const r of t){ if (typeof r === 'string') { e.add(r); } else if (typeof r === 'number') { e.add(String(r)); } } return e; } function v(t) { const e = h(t); const r = d(t, 'bigint'); const n = d(t, 'deterministic'); const i = p(t, 'maximumDepth'); const o = p(t, 'maximumBreadth'); function s(t, u, h, d, p, b) { let v = u[t]; if (typeof v === 'object' && v !== null && typeof v.toJSON === 'function') { v = v.toJSON(t); } v = d.call(u, t, v); switch(typeof v){ case 'string': return `"${a(v)}"`; case 'object': { if (v === null) { return 'null'; } if (h.indexOf(v) !== -1) { return e; } let y = ''; let m = ','; const w = b; if (Array.isArray(v)) { if (v.length === 0) { return '[]'; } if (i < h.length + 1) { return '"[Array]"'; } h.push(v); if (p !== '') { b += p; y += `\n${b}`; m = `,\n${b}`; } const _ = Math.min(v.length, o); let S = 0; for(; S < _ - 1; S++){ const E = s(S, v, h, d, p, b); y += E !== undefined ? E : 'null'; y += m; } const x = s(S, v, h, d, p, b); y += x !== undefined ? x : 'null'; if (v.length - 1 > o) { const M = v.length - o - 1; y += `${m}"... ${g(M)} not stringified"`; } if (p !== '') { y += `\n${w}`; } h.pop(); return `[${y}]`; } let T = Object.keys(v); const A = T.length; if (A === 0) { return '{}'; } if (i < h.length + 1) { return '"[Object]"'; } let O = ''; let k = ''; if (p !== '') { b += p; m = `,\n${b}`; O = ' '; } let I = Math.min(A, o); if (c(v)) { y += l(v, m, o); T = T.slice(v.length); I -= v.length; k = m; } if (n) { T = f(T); } h.push(v); for(let R = 0; R < I; R++){ const N = T[R]; const j = s(N, v, h, d, p, b); if (j !== undefined) { y += `${k}"${a(N)}":${O}${j}`; k = m; } } if (A > o) { const P = A - o; y += `${k}"...":${O}"${g(P)} not stringified"`; k = m; } if (p !== '' && k.length > 1) { y = `\n${b}${y}\n${w}`; } h.pop(); return `{${y}}`; } case 'number': return isFinite(v) ? String(v) : 'null'; case 'boolean': return v === true ? 'true' : 'false'; case 'bigint': return r ? String(v) : undefined; } } function u(t, n, s, f, c, l) { if (typeof n === 'object' && n !== null && typeof n.toJSON === 'function') { n = n.toJSON(t); } switch(typeof n){ case 'string': return `"${a(n)}"`; case 'object': { if (n === null) { return 'null'; } if (s.indexOf(n) !== -1) { return e; } const h = l; let d = ''; let p = ','; if (Array.isArray(n)) { if (n.length === 0) { return '[]'; } if (i < s.length + 1) { return '"[Array]"'; } s.push(n); if (c !== '') { l += c; d += `\n${l}`; p = `,\n${l}`; } const b = Math.min(n.length, o); let v = 0; for(; v < b - 1; v++){ const y = u(v, n[v], s, f, c, l); d += y !== undefined ? y : 'null'; d += p; } const m = u(v, n[v], s, f, c, l); d += m !== undefined ? m : 'null'; if (n.length - 1 > o) { const w = n.length - o - 1; d += `${p}"... ${g(w)} not stringified"`; } if (c !== '') { d += `\n${h}`; } s.pop(); return `[${d}]`; } if (f.size === 0) { return '{}'; } s.push(n); let _ = ''; if (c !== '') { l += c; p = `,\n${l}`; _ = ' '; } let S = ''; for (const E of f){ const x = u(E, n[E], s, f, c, l); if (x !== undefined) { d += `${S}"${a(E)}":${_}${x}`; S = p; } } if (c !== '' && S.length > 1) { d = `\n${l}${d}\n${h}`; } s.pop(); return `{${d}}`; } case 'number': return isFinite(n) ? String(n) : 'null'; case 'boolean': return n === true ? 'true' : 'false'; case 'bigint': return r ? String(n) : undefined; } } function v(t, s, u, h, d) { switch(typeof s){ case 'string': return `"${a(s)}"`; case 'object': { if (s === null) { return 'null'; } if (typeof s.toJSON === 'function') { s = s.toJSON(t); if (typeof s !== 'object') { return v(t, s, u, h, d); } if (s === null) { return 'null'; } } if (u.indexOf(s) !== -1) { return e; } const p = d; if (Array.isArray(s)) { if (s.length === 0) { return '[]'; } if (i < u.length + 1) { return '"[Array]"'; } u.push(s); d += h; let b = `\n${d}`; const y = `,\n${d}`; const m = Math.min(s.length, o); let w = 0; for(; w < m - 1; w++){ const _ = v(w, s[w], u, h, d); b += _ !== undefined ? _ : 'null'; b += y; } const S = v(w, s[w], u, h, d); b += S !== undefined ? S : 'null'; if (s.length - 1 > o) { const E = s.length - o - 1; b += `${y}"... ${g(E)} not stringified"`; } b += `\n${p}`; u.pop(); return `[${b}]`; } let x = Object.keys(s); const M = x.length; if (M === 0) { return '{}'; } if (i < u.length + 1) { return '"[Object]"'; } d += h; const T = `,\n${d}`; let A = ''; let O = ''; let k = Math.min(M, o); if (c(s)) { A += l(s, T, o); x = x.slice(s.length); k -= s.length; O = T; } if (n) { x = f(x); } u.push(s); for(let I = 0; I < k; I++){ const R = x[I]; const N = v(R, s[R], u, h, d); if (N !== undefined) { A += `${O}"${a(R)}": ${N}`; O = T; } } if (M > o) { const j = M - o; A += `${O}"...": "${g(j)} not stringified"`; O = T; } if (O !== '') { A = `\n${d}${A}\n${p}`; } u.pop(); return `{${A}}`; } case 'number': return isFinite(s) ? String(s) : 'null'; case 'boolean': return s === true ? 'true' : 'false'; case 'bigint': return r ? String(s) : undefined; } } function y(t, s, u) { switch(typeof s){ case 'string': return `"${a(s)}"`; case 'object': { if (s === null) { return 'null'; } if (typeof s.toJSON === 'function') { s = s.toJSON(t); if (typeof s !== 'object') { return y(t, s, u); } if (s === null) { return 'null'; } } if (u.indexOf(s) !== -1) { return e; } let h = ''; if (Array.isArray(s)) { if (s.length === 0) { return '[]'; } if (i < u.length + 1) { return '"[Array]"'; } u.push(s); const d = Math.min(s.length, o); let p = 0; for(; p < d - 1; p++){ const b = y(p, s[p], u); h += b !== undefined ? b : 'null'; h += ','; } const v = y(p, s[p], u); h += v !== undefined ? v : 'null'; if (s.length - 1 > o) { const m = s.length - o - 1; h += `,"... ${g(m)} not stringified"`; } u.pop(); return `[${h}]`; } let w = Object.keys(s); const _ = w.length; if (_ === 0) { return '{}'; } if (i < u.length + 1) { return '"[Object]"'; } let S = ''; let E = Math.min(_, o); if (c(s)) { h += l(s, ',', o); w = w.slice(s.length); E -= s.length; S = ','; } if (n) { w = f(w); } u.push(s); for(let x = 0; x < E; x++){ const M = w[x]; const T = y(M, s[M], u); if (T !== undefined) { h += `${S}"${a(M)}":${T}`; S = ','; } } if (_ > o) { const A = _ - o; h += `${S}"...":"${g(A)} not stringified"`; } u.pop(); return `{${h}}`; } case 'number': return isFinite(s) ? String(s) : 'null'; case 'boolean': return s === true ? 'true' : 'false'; case 'bigint': return r ? String(s) : undefined; } } function m(t, e, r) { if (arguments.length > 1) { let n = ''; if (typeof r === 'number') { n = ' '.repeat(Math.min(r, 10)); } else if (typeof r === 'string') { n = r.slice(0, 10); } if (e != null) { if (typeof e === 'function') { return s('', { '': t }, [], e, n, ''); } if (Array.isArray(e)) { return u('', t, [], b(e), n, ''); } } if (n.length !== 0) { return v('', t, [], n, ''); } } return y('', t, []); } return m; } }), 2399: (function(t, e, r) { "use strict"; var n = r(3454); var i = r(8764); var o = i.Buffer; var s = {}; var a; for(a in i){ if (!i.hasOwnProperty(a)) continue; if (a === 'SlowBuffer' || a === 'Buffer') continue; s[a] = i[a]; } var f = s.Buffer = {}; for(a in o){ if (!o.hasOwnProperty(a)) continue; if (a === 'allocUnsafe' || a === 'allocUnsafeSlow') continue; f[a] = o[a]; } s.Buffer.prototype = o.prototype; if (!f.from || f.from === Uint8Array.from) { f.from = function(t, e, r) { if (typeof t === 'number') { throw new TypeError('The "value" argument must not be of type number. Received type ' + typeof t); } if (t && typeof t.length === 'undefined') { throw new TypeError('The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type ' + typeof t); } return o(t, e, r); }; } if (!f.alloc) { f.alloc = function(t, e, r) { if (typeof t !== 'number') { throw new TypeError('The "size" argument must be of type number. Received type ' + typeof t); } if (t < 0 || t >= 2 * (1 << 30)) { throw new RangeError('The value "' + t + '" is invalid for option "size"'); } var n = o(t); if (!e || e.length === 0) { n.fill(0); } else if (typeof r === 'string') { n.fill(e, r); } else { n.fill(e); } return n; }; } if (!s.kStringMaxLength) { try { s.kStringMaxLength = n.binding('buffer').kStringMaxLength; } catch (u) {} } if (!s.constants) { s.constants = { MAX_LENGTH: s.kMaxLength }; if (s.kStringMaxLength) { s.constants.MAX_STRING_LENGTH = s.kStringMaxLength; } } t.exports = s; }), 2553: (function(t, e, r) { "use strict"; var n = (r(9509).Buffer); var i = n.isEncoding || function(t) { t = '' + t; switch(t && t.toLowerCase()){ case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; default: return false; } }; function o(t) { if (!t) return 'utf8'; var e; while(true){ switch(t){ case 'utf8': case 'utf-8': return 'utf8'; case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': return 'utf16le'; case 'latin1': case 'binary': return 'latin1'; case 'base64': case 'ascii': case 'hex': return t; default: if (e) return; t = ('' + t).toLowerCase(); e = true; } } } ; function s(t) { var e = o(t); if (typeof e !== 'string' && (n.isEncoding === i || !i(t))) throw new Error('Unknown encoding: ' + t); return e || t; } e.StringDecoder = a; function a(t) { this.encoding = s(t); var e; switch(this.encoding){ case 'utf16le': this.text = p; this.end = g; e = 4; break; case 'utf8': this.fillLast = l; e = 4; break; case 'base64': this.text = b; this.end = v; e = 3; break; default: this.write = y; this.end = m; return; } this.lastNeed = 0; this.lastTotal = 0; this.lastChar = n.allocUnsafe(e); } a.prototype.write = function(t) { if (t.length === 0) return ''; var e; var r; if (this.lastNeed) { e = this.fillLast(t); if (e === undefined) return ''; r = this.lastNeed; this.lastNeed = 0; } else { r = 0; } if (r < t.length) return e ? e + this.text(t, r) : this.text(t, r); return e || ''; }; a.prototype.end = d; a.prototype.text = h; a.prototype.fillLast = function(t) { if (this.lastNeed <= t.length) { t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } t.copy(this.lastChar, this.lastTotal - this.lastNeed, 0, t.length); this.lastNeed -= t.length; }; function f(t) { if (t <= 0x7F) return 0; else if (t >> 5 === 0x06) return 2; else if (t >> 4 === 0x0E) return 3; else if (t >> 3 === 0x1E) return 4; return t >> 6 === 0x02 ? -1 : -2; } function u(t, e, r) { var n = e.length - 1; if (n < r) return 0; var i = f(e[n]); if (i >= 0) { if (i > 0) t.lastNeed = i - 1; return i; } if (--n < r || i === -2) return 0; i = f(e[n]); if (i >= 0) { if (i > 0) t.lastNeed = i - 2; return i; } if (--n < r || i === -2) return 0; i = f(e[n]); if (i >= 0) { if (i > 0) { if (i === 2) i = 0; else t.lastNeed = i - 3; } return i; } return 0; } function c(t, e, r) { if ((e[0] & 0xC0) !== 0x80) { t.lastNeed = 0; return '\ufffd'; } if (t.lastNeed > 1 && e.length > 1) { if ((e[1] & 0xC0) !== 0x80) { t.lastNeed = 1; return '\ufffd'; } if (t.lastNeed > 2 && e.length > 2) { if ((e[2] & 0xC0) !== 0x80) { t.lastNeed = 2; return '\ufffd'; } } } } function l(t) { var e = this.lastTotal - this.lastNeed; var r = c(this, t, e); if (r !== undefined) return r; if (this.lastNeed <= t.length) { t.copy(this.lastChar, e, 0, this.lastNeed); return this.lastChar.toString(this.encoding, 0, this.lastTotal); } t.copy(this.lastChar, e, 0, t.length); this.lastNeed -= t.length; } function h(t, e) { var r = u(this, t, e); if (!this.lastNeed) return t.toString('utf8', e); this.lastTotal = r; var n = t.length - (r - this.lastNeed); t.copy(this.lastChar, 0, n); return t.toString('utf8', e, n); } function d(t) { var e = t && t.length ? this.write(t) : ''; if (this.lastNeed) return e + '\ufffd'; return e; } function p(t, e) { if ((t.length - e) % 2 === 0) { var r = t.toString('utf16le', e); if (r) { var n = r.charCodeAt(r.length - 1); if (n >= 0xD800 && n <= 0xDBFF) { this.lastNeed = 2; this.lastTotal = 4; this.lastChar[0] = t[t.length - 2]; this.lastChar[1] = t[t.length - 1]; return r.slice(0, -1); } } return r; } this.lastNeed = 1; this.lastTotal = 2; this.lastChar[0] = t[t.length - 1]; return t.toString('utf16le', e, t.length - 1); } function g(t) { var e = t && t.length ? this.write(t) : ''; if (this.lastNeed) { var r = this.lastTotal - this.lastNeed; return e + this.lastChar.toString('utf16le', 0, r); } return e; } function b(t, e) { var r = (t.length - e) % 3; if (r === 0) return t.toString('base64', e); this.lastNeed = 3 - r; this.lastTotal = 3; if (r === 1) { this.lastChar[0] = t[t.length - 1]; } else { this.lastChar[0] = t[t.length - 2]; this.lastChar[1] = t[t.length - 1]; } return t.toString('base64', e, t.length - r); } function v(t) { var e = t && t.length ? this.write(t) : ''; if (this.lastNeed) return e + this.lastChar.toString('base64', 0, 3 - this.lastNeed); return e; } function y(t) { return t.toString(this.encoding); } function m(t) { return t && t.length ? this.write(t) : ''; } }), 3931: (function(t, e, r) { "use strict"; r.r(e); r.d(e, { "HTTPRangeReader": function() { return h; }, "cleanup": function() { return tv; }, "setOptions": function() { return tp; }, "unzip": function() { return tb; }, "unzipRaw": function() { return tg; } }); t = r.hmd(t); var n = r(3454); function i(t) { if (t.arrayBuffer) { return t.arrayBuffer(); } return new Promise((e, r)=>{ const n = new FileReader(); n.addEventListener('loadend', ()=>{ e(n.result); }); n.addEventListener('error', r); n.readAsArrayBuffer(t); }); } async function o(t) { const e = await i(t); return new Uint8Array(e); } function s(t) { return typeof Blob !== 'undefined' && t instanceof Blob; } function a(t) { return typeof SharedArrayBuffer !== 'undefined' && t instanceof SharedArrayBuffer; } const f = (typeof n !== 'undefined') && n.versions && (typeof n.versions.node !== 'undefined') && (typeof n.versions.electron === 'undefined'); function u(t) { return t.byteOffset === 0 && t.byteLength === t.buffer.byteLength; } class c { constructor(t){ this.typedArray = (t instanceof ArrayBuffer || a(t)) ? new Uint8Array(t) : new Uint8Array(t.buffer, t.byteOffset, t.byteLength); } async getLength() { return this.typedArray.byteLength; } async read(t, e) { return new Uint8Array(this.typedArray.buffer, this.typedArray.byteOffset + t, e); } } class l { constructor(t){ this.blob = t; } async getLength() { return this.blob.size; } async read(t, e) { const r = this.blob.slice(t, t + e); const n = await i(r); return new Uint8Array(n); } async sliceAsBlob(t, e, r = '') { return this.blob.slice(t, t + e, r); } } class h { constructor(t){ this.url = t; } async getLength() { if (this.length === undefined) { const t = await fetch(this.url, { method: 'HEAD' }); if (!t.ok) { throw new Error(`failed http request ${this.url}, status: ${t.status}: ${t.statusText}`); } this.length = parseInt(t.headers.get('content-length')); if (Number.isNaN(this.length)) { throw Error('could not get length'); } } return this.length; } async read(t, e) { if (e === 0) { return new Uint8Array(0); } const r = await fetch(this.url, { headers: { Range: `bytes=${t}-${t + e - 1}` } }); if (!r.ok) { throw new Error(`failed http request ${this.url}, status: ${r.status} offset: ${t} size: ${e}: ${r.statusText}`); } const n = await r.arrayBuffer(); return new Uint8Array(n); } } function d(t, e) { var r = Uint8Array; if (t[0] == 3 && t[1] == 0) return (e ? e : new r(0)); var n = _, i = w, o = g, s = S; var a = (e == null); if (a) e = new r((t.length >>> 2) << 3); var f = 0, u = 0, c = 0, l = 0, h = 0, d = 0, m = 0; var x = 0, M = 0; var T, A; while(f == 0){ f = n(t, M, 1); u = n(t, M + 1, 2); M += 3; if (u == 0) { if ((M & 7) != 0) M += 8 - (M & 7); var O = (M >>> 3) + 4, k = t[O - 4] | (t[O - 3] << 8); if (a) e = p(e, x + k); e.set(new r(t.buffer, t.byteOffset + O, k), x); M = ((O + k) << 3); x += k; continue; } if (a) e = p(e, x + (1 << 17)); if (u == 1) { T = E.flmap; A = E.fdmap; d = (1 << 9) - 1; m = (1 << 5) - 1; } if (u == 2) { c = i(t, M, 5) + 257; l = i(t, M + 5, 5) + 1; h = i(t, M + 10, 4) + 4; M += 14; for(var I = 0; I < 38; I += 2){ E.itree[I] = 0; E.itree[I + 1] = 0; } var R = 1; for(var I = 0; I < h; I++){ var N = i(t, M + I * 3, 3); E.itree[(E.ordr[I] << 1) + 1] = N; if (N > R) R = N; } M += 3 * h; v(E.itree, R); y(E.itree, R, E.imap); T = E.lmap; A = E.dmap; M = o(E.imap, (1 << R) - 1, c + l, t, M, E.ttree); var j = b(E.ttree, 0, c, E.ltree); d = (1 << j) - 1; var P = b(E.ttree, c, l, E.dtree); m = (1 << P) - 1; v(E.ltree, j); y(E.ltree, j, T); v(E.dtree, P); y(E.dtree, P, A); } while(true){ var C = T[s(t, M) & d]; M += C & 15; var B = C >>> 4; if ((B >>> 8) == 0) { e[x++] = B; } else if (B == 256) { break; } else { var L = x + B - 254; if (B > 264) { var U = E.ldef[B - 257]; L = x + (U >>> 3) + i(t, M, U & 7); M += U & 7; } var D = A[s(t, M) & m]; M += D & 15; var $ = D >>> 4; var F = E.ddef[$], W = (F >>> 4) + n(t, M, F & 15); M += F & 15; if (a) e = p(e, x + (1 << 17)); while(x < L){ e[x] = e[x++ - W]; e[x] = e[x++ - W]; e[x] = e[x++ - W]; e[x] = e[x++ - W]; } x = L; } } } return e.length == x ? e : e.slice(0, x); } function p(t, e) { var r = t.length; if (e <= r) return t; var n = new Uint8Array(Math.max(r << 1, e)); n.set(t, 0); return n; } function g(t, e, r, n, i, o) { var s = w, a = S; var f = 0; while(f < r){ var u = t[a(n, i) & e]; i += u & 15; var c = u >>> 4; if (c <= 15) { o[f] = c; f++; } else { var l = 0, h = 0; if (c == 16) { h = (3 + s(n, i, 2)); i += 2; l = o[f - 1]; } else if (c == 17) { h = (3 + s(n, i, 3)); i += 3; } else if (c == 18) { h = (11 + s(n, i, 7)); i += 7; } var d = f + h; while(f < d){ o[f] = l; f++; } } } return i; } function b(t, e, r, n) { var i = 0, o = 0, s = n.length >>> 1; while(o < r){ var a = t[o + e]; n[(o << 1)] = 0; n[(o << 1) + 1] = a; if (a > i) i = a; o++; } while(o < s){ n[(o << 1)] = 0; n[(o << 1) + 1] = 0; o++; } return i; } function v(t, e) { var r = t.length; var n, i, o, s, a; var f = E.bl_count; for(var s = 0; s <= e; s++)f[s] = 0; for(s = 1; s < r; s += 2)f[t[s]]++; var u = E.next_code; n = 0; f[0] = 0; for(i = 1; i <= e; i++){ n = (n + f[i - 1]) << 1; u[i] = n; } for(o = 0; o < r; o += 2){ a = t[o + 1]; if (a != 0) { t[o] = u[a]; u[a]++; } } } function y(t, e, r) { var n = t.length; var i = E.rev15; for(var o = 0; o < n; o += 2)if (t[o + 1] != 0) { var s = o >> 1; var a = t[o + 1], f = (s << 4) | a; var u = (e - a), c = t[o] << u, l = c + (1 << u); while(c != l){ var h = i[c] >>> (15 - e); r[h] = f; c++; } } } function m(t, e) { var r = E.rev15, n = 15 - e; for(var i = 0; i < t.length; i += 2){ var o = (t[i] << (e - t[i + 1])); t[i] = r[o] >>> n; } } function w(t, e, r) { return ((t[e >>> 3] | (t[(e >>> 3) + 1] << 8)) >>> (e & 7)) & ((1 << r) - 1); } function _(t, e, r) { return ((t[e >>> 3] | (t[(e >>> 3) + 1] << 8) | (t[(e >>> 3) + 2] << 16)) >>> (e & 7)) & ((1 << r) - 1); } function S(t, e) { return (t[e >>> 3] | (t[(e >>> 3) + 1] << 8) | (t[(e >>> 3) + 2] << 16)) >>> (e & 7); } const E = function() { var t = Uint16Array, e = Uint32Array; return { next_code: new t(16), bl_count: new t(16), ordr: [ 16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15 ], of0: [ 3, 4, 5, 6, 7, 8, 9, 10, 11, 13, 15, 17, 19, 23, 27, 31, 35, 43, 51, 59, 67, 83, 99, 115, 131, 163, 195, 227, 258, 999, 999, 999 ], exb: [ 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0, 0, 0, 0 ], ldef: new t(32), df0: [ 1, 2, 3, 4, 5, 7, 9, 13, 17, 25, 33, 49, 65, 97, 129, 193, 257, 385, 513, 769, 1025, 1537, 2049, 3073, 4097, 6145, 8193, 12289, 16385, 24577, 65535, 65535 ], dxb: [ 0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13, 0, 0 ], ddef: new e(32), flmap: new t(512), fltree: [], fdmap: new t(32), fdtree: [], lmap: new t(32768), ltree: [], ttree: [], dmap: new t(32768), dtree: [], imap: new t(512), itree: [], rev15: new t(1 << 15), lhst: new e(286), dhst: new e(30), ihst: new e(19), lits: new e(15000), strt: new t(1 << 16), prev: new t(1 << 15) }; }(); (function() { var t = 1 << 15; for(var e = 0; e < t; e++){ var r = e; r = (((r & 0xaaaaaaaa) >>> 1) | ((r & 0x55555555) << 1)); r = (((r & 0xcccccccc) >>> 2) | ((r & 0x33333333) << 2)); r = (((r & 0xf0f0f0f0) >>> 4) | ((r & 0x0f0f0f0f) << 4)); r = (((r & 0xff00ff00) >>> 8) | ((r & 0x00ff00ff) << 8)); E.rev15[e] = (((r >>> 16) | (r << 16))) >>> 17; } function n(t, e, r) { while(e-- != 0)t.push(0, r); } for(var e = 0; e < 32; e++){ E.ldef[e] = (E.of0[e] << 3) | E.exb[e]; E.ddef[e] = (E.df0[e] << 4) | E.dxb[e]; } n(E.fltree, 144, 8); n(E.fltree, 255 - 143, 9); n(E.fltree, 279 - 255, 7); n(E.fltree, 287 - 279, 8); v(E.fltree, 9); y(E.fltree, 9, E.flmap); m(E.fltree, 9); n(E.fdtree, 32, 5); v(E.fdtree, 5); y(E.fdtree, 5, E.fdmap); m(E.fdtree, 5); n(E.itree, 19, 0); n(E.ltree, 286, 0); n(E.dtree, 30, 0); n(E.ttree, 320, 0); })(); const x = { table: (function() { var t = new Uint32Array(256); for(var e = 0; e < 256; e++){ var r = e; for(var n = 0; n < 8; n++){ if (r & 1) r = 0xedb88320 ^ (r >>> 1); else r = r >>> 1; } t[e] = r; } return t; })(), update: function(t, e, r, n) { for(var i = 0; i < n; i++)t = x.table[(t ^ e[r + i]) & 0xff] ^ (t >>> 8); return t; }, crc: function(t, e, r) { return x.update(0xffffffff, t, e, r) ^ 0xffffffff; } }; function M(t, e) { return d(t, e); } const T = { numWorkers: 1, workerURL: '', useWorkers: false }; let A = 0; let O = 0; let k = true; const I = []; const R = []; const N = []; const j = new Map(); function P(t) { U(t.target); const { id: e , error: r , data: n } = t.data; const i = j.get(e); j.delete(e); if (r) { i.reject(r); } else { i.resolve(n); } } function C(t) { return new Promise((e, r)=>{ const n = new Worker(t); n.onmessage = (t)=>{ if (t.data === 'start') { n.onerror = undefined; n.onmessage = undefined; e(n); } else { r(new Error(`unexpected message: ${t.data}`)); } }; n.onerror = r; }); } function B(t, e) { return t.require(e); } const L = (function() { if (f) { const { Worker: e } = B(t, 'worker_threads'); return { async createWorker (t) { return new e(t); }, addEventListener (t, e) { t.on('message', (r)=>{ e({ target: t, data: r }); }); }, async terminate (t) { await t.terminate(); } }; } else { return { async createWorker (t) { try { const e = await C(t); return e; } catch (r) { console.warn('could not load worker:', t); } let n; try { const i = await fetch(t, { mode: 'cors' }); if (!i.ok) { throw new Error(`could not load: ${t}`); } n = await i.text(); t = URL.createObjectURL(new Blob([ n ], { type: 'application/javascript' })); const o = await C(t); T.workerURL = t; return o; } catch (s) { console.warn('could not load worker via fetch:', t); } if (n !== undefined) { try { t = `data:application/javascript;base64,${btoa(n)}`; const a = await C(t); T.workerURL = t; return a; } catch (f) { console.warn('could not load worker via dataURI'); } } console.warn('workers will not be used'); throw new Error('can not start workers'); }, addEventListener (t, e) { t.addEventListener('message', e); }, async terminate (t) { t.terminate(); } }; } }()); function U(t) { R.push(t); F(); } async function D() { if (R.length === 0 && O < T.numWorkers) { ++O; try { const t = await L.createWorker(T.workerURL); I.push(t); R.push(t); L.addEventListener(t, P); } catch (e) { k = false; } } return R.pop(); } function $(t, e, r, n) { const i = new Uint8Array(e); M(t, i); n(r ? new Blob([ i ], { type: r }) : i.buffer); } async function F() { if (N.length === 0) { return; } if (T.useWorkers && k) { const t = await D(); if (k) { if (t) { if (N.length === 0) { U(t); return; } const { id: e , src: r , uncompressedSize: n , type: i , resolve: a , reject: f } = N.shift(); j.set(e, { id: e, resolve: a, reject: f }); const u = []; t.postMessage({ type: 'inflate', data: { id: e, type: i, src: r, uncompressedSize: n } }, u); } return; } } while(N.length){ const { src: c , uncompressedSize: l , type: h , resolve: d } = N.shift(); let p = c; if (s(c)) { p = await o(c); } $(p, l, h, d); } } function W(t) { T.workerURL = t.workerURL || T.workerURL; if (t.workerURL) { T.useWorkers = true; } T.useWorkers = t.useWorkers !== undefined ? t.useWorkers : T.useWorkers; T.numWorkers = t.numWorkers || T.numWorkers; } function q(t, e, r) { return new Promise((n, i)=>{ N.push({ src: t, uncompressedSize: e, type: r, resolve: n, reject: i, id: A++ }); F(); }); } function z(t) { t.splice(0, t.length); } async function G() { for (const t of I){ await L.terminate(t); } z(I); z(R); z(N); j.clear(); O = 0; k = true; } function K(t, e) { const r = t & 0x1f; const n = (t >> 5 & 0xf) - 1; const i = (t >> 9 & 0x7f) + 1980; const o = 0; const s = (e & 0x1f) * 2; const a = e >> 5 & 0x3f; const f = e >> 11 & 0x1f; return new Date(i, n, r, f, a, s, o); } class V { constructor(t, e){ this._reader = t; this._rawEntry = e; this.name = e.name; this.nameBytes = e.nameBytes; this.size = e.uncompressedSize; this.compressedSize = e.compressedSize; this.comment = e.comment; this.commentBytes = e.commentBytes; this.compressionMethod = e.compressionMethod; this.lastModDate = K(e.lastModFileDate, e.lastModFileTime); this.isDirectory = e.uncompressedSize === 0 && e.name.endsWith('/'); this.encrypted = !!(e.generalPurposeBitFlag & 0x1); this.externalFileAttributes = e.externalFileAttributes; this.versionMadeBy = e.versionMadeBy; } async blob(t = 'application/octet-stream') { return await td(this._reader, this._rawEntry, t); } async arrayBuffer() { return await th(this._reader, this._rawEntry); } async text() { const t = await this.arrayBuffer(); return to(new Uint8Array(t)); } async json() { const t = await this.text(); return JSON.parse(t); } } const H = 22; const J = 0xffff; const X = 0x06054b50; const Y = 0x06064b50; async function Z(t, e, r) { return await t.read(e, r); } async function Q(t, e, r, n) { if (t.sliceAsBlob) { return await t.sliceAsBlob(e, r, n); } return await t.read(e, r); } const tt = { unsigned () { return 0; } }; function te(t, e) { return t[e] + t[e + 1] * 0x100; } function tr(t, e) { return t[e] + t[e + 1] * 0x100 + t[e + 2] * 0x10000 + t[e + 3] * 0x1000000; } function tn(t, e) { return tr(t, e) + tr(t, e + 4) * 0x100000000; } const ti = new TextDecoder(); function to(t, e) { if (a(t.buffer)) { t = new Uint8Array(t); } return ti.decode(t); } async function ts(t, e) { const r = Math.min(H + J, e); const n = e - r; const i = await Z(t, n, r); for(let o = r - H; o >= 0; --o){ if (tr(i, o) !== X) { continue; } const s = new Uint8Array(i.buffer, i.byteOffset + o, i.byteLength - o); const a = te(s, 4); if (a !== 0) { throw new Error(`multi-volume zip files are not supported. This is volume: ${a}`); } const f = te(s, 10); const u = tr(s, 12); const c = tr(s, 16); const l = te(s, 20); const h = s.length - H; if (l !== h) { throw new Error(`invalid comment length. expected: ${h}, actual: ${l}`); } const d = new Uint8Array(s.buffer, s.byteOffset + 22, l); const p = to(d); if (f === 0xffff || c === 0xffffffff) { return await tf(t, n + o, p, d); } else { return await tc(t, c, u, f, p, d); } } throw new Error('could not find end of central directory. maybe not zip file'); } const ta = 0x07064b50; async function tf(t, e, r, n) { const i = e - 20; const o = await Z(t, i, 20); if (tr(o, 0) !== ta) { throw new Error('invalid zip64 end of central directory locator signature'); } const s = tn(o, 8); const a = await Z(t, s, 56); if (tr(a, 0) !== Y) { throw new Error('invalid zip64 end of central directory record signature'); } const f = tn(a, 32); const u = tn(a, 40); const c = tn(a, 48); return tc(t, c, u, f, r, n); } const tu = 0x02014b50; async function tc(t, e, r, n, i, o) { let s = 0; const a = await Z(t, e, r); const f = []; for(let u = 0; u < n; ++u){ const c = a.subarray(s, s + 46); const l = tr(c, 0); if (l !== tu) { throw new Error(`invalid central directory file header signature: 0x${l.toString(16)}`); } const h = { versionMadeBy: te(c, 4), versionNeededToExtract: te(c, 6), generalPurposeBitFlag: te(c, 8), compressionMethod: te(c, 10), lastModFileTime: te(c, 12), lastModFileDate: te(c, 14), crc32: tr(c, 16), compressedSize: tr(c, 20), uncompressedSize: tr(c, 24), fileNameLength: te(c, 28), extraFieldLength: te(c, 30), fileCommentLength: te(c, 32), internalFileAttributes: te(c, 36), externalFileAttributes: tr(c, 38), relativeOffsetOfLocalHeader: tr(c, 42) }; if (h.generalPurposeBitFlag & 0x40) { throw new Error('strong encryption is not supported'); } s += 46; const d = a.subarray(s, s + h.fileNameLength + h.extraFieldLength + h.fileCommentLength); h.nameBytes = d.slice(0, h.fileNameLength); h.name = to(h.nameBytes); const p = h.fileNameLength + h.extraFieldLength; const g = d.slice(h.fileNameLength, p); h.extraFields = []; let b = 0; while(b < g.length - 3){ const v = te(g, b + 0); const y = te(g, b + 2); const m = b + 4; const w = m + y; if (w > g.length) { throw new Error('extra field length exceeds extra field buffer size'); } h.extraFields.push({ id: v, data: g.slice(m, w) }); b = w; } h.commentBytes = d.slice(p, p + h.fileCommentLength); h.comment = to(h.commentBytes); s += d.length; if (h.uncompressedSize === 0xffffffff || h.compressedSize === 0xffffffff || h.relativeOffsetOfLocalHeader === 0xffffffff) { const _ = h.extraFields.find((t)=>t.id === 0x0001); if (!_) { throw new Error('expected zip64 extended information extra field'); } const S = _.data; let E = 0; if (h.uncompressedSize === 0xffffffff) { if (E + 8 > S.length) { throw new Error('zip64 extended information extra field does not include uncompressed size'); } h.uncompressedSize = tn(S, E); E += 8; } if (h.compressedSize === 0xffffffff) { if (E + 8 > S.length) { throw new Error('zip64 extended information extra field does not include compressed size'); } h.compressedSize = tn(S, E); E += 8; } if (h.relativeOffsetOfLocalHeader === 0xffffffff) { if (E + 8 > S.length) { throw new Error('zip64 extended information extra field does not include relative header offset'); } h.relativeOffsetOfLocalHeader = tn(S, E); E += 8; } } const x = h.extraFields.find((t)=>t.id === 0x7075 && t.data.length >= 6 && t.data[0] === 1 && tr(t.data, 1), tt.unsigned(h.nameBytes)); if (x) { h.fileName = to(x.data.slice(5)); } if (h.compressionMethod === 0) { let M = h.uncompressedSize; if ((h.generalPurposeBitFlag & 0x1) !== 0) { M += 12; } if (h.compressedSize !== M) { throw new Error(`compressed size mismatch for stored file: ${h.compressedSize} != ${M}`); } } f.push(h); } const T = { comment: i, commentBytes: o }; return { zip: T, entries: f.map((e)=>new V(t, e)) }; } async function tl(t, e) { if (e.generalPurposeBitFlag & 0x1) { throw new Error('encrypted entries not supported'); } const r = await Z(t, e.relativeOffsetOfLocalHeader, 30); const n = await t.getLength(); const i = tr(r, 0); if (i !== 0x04034b50) { throw new Error(`invalid local file header signature: 0x${i.toString(16)}`); } const o = te(r, 26); const s = te(r, 28); const a = e.relativeOffsetOfLocalHeader + r.length + o + s; let f; if (e.compressionMethod === 0) { f = false; } else if (e.compressionMethod === 8) { f = true; } else { throw new Error(`unsupported compression method: ${e.compressionMethod}`); } const u = a; const c = u + e.compressedSize; if (e.compressedSize !== 0) { if (c > n) { throw new Error(`file data overflows file bounds: ${u} + ${e.compressedSize} > ${n}`); } } return { decompress: f, fileDataStart: u }; } async function th(t, e) { const { decompress: r , fileDataStart: n } = await tl(t, e); if (!r) { const i = await Z(t, n, e.compressedSize); return u(i) ? i.buffer : i.slice().buffer; } const o = await Q(t, n, e.compressedSize); const s = await q(o, e.uncompressedSize); return s; } async function td(t, e, r) { const { decompress: n , fileDataStart: i } = await tl(t, e); if (!n) { const o = await Q(t, i, e.compressedSize, r); if (s(o)) { return o; } return new Blob([ a(o.buffer) ? new Uint8Array(o) : o ], { type: r }); } const f = await Q(t, i, e.compressedSize); const u = await q(f, e.uncompressedSize, r); return u; } function tp(t) { W(t); } async function tg(t) { let e; if (typeof Blob !== 'undefined' && t instanceof Blob) { e = new l(t); } else if (t instanceof ArrayBuffer || (t && t.buffer && t.buffer instanceof ArrayBuffer)) { e = new c(t); } else if (a(t) || a(t.buffer)) { e = new c(t); } else if (typeof t === 'string') { const r = await fetch(t); if (!r.ok) { throw new Error(`failed http request ${t}, status: ${r.status}: ${r.statusText}`); } const n = await r.blob(); e = new l(n); } else if (typeof t.getLength === 'function' && typeof t.read === 'function') { e = t; } else { throw new Error('unsupported source type'); } const i = await e.getLength(); if (i > Number.MAX_SAFE_INTEGER) { throw new Error(`file too large. size: ${i}. Only file sizes up 4503599627370496 bytes are supported`); } return await ts(e, i); } async function tb(t) { const { zip: e , entries: r } = await tg(t); return { zip: e, entries: Object.fromEntries(r.map((t)=>[ t.name, t ])) }; } function tv() { G(); } }), 384: (function(t) { t.exports = function t(e) { return e && typeof e === 'object' && typeof e.copy === 'function' && typeof e.fill === 'function' && typeof e.readUInt8 === 'function'; }; }), 5955: (function(t, e, r) { "use strict"; var n = r(2584); var i = r(8662); var o = r(6430); var s = r(5692); function a(t) { return t.call.bind(t); } var f = typeof BigInt !== 'undefined'; var u = typeof Symbol !== 'undefined'; var c = a(Object.prototype.toString); var l = a(Number.prototype.valueOf); var h = a(String.prototype.valueOf); var d = a(Boolean.prototype.valueOf); if (f) { var p = a(BigInt.prototype.valueOf); } if (u) { var g = a(Symbol.prototype.valueOf); } function b(t, e) { if (typeof t !== 'object') { return false; } try { e(t); return true; } catch (r) { return false; } } e.isArgumentsObject = n; e.isGeneratorFunction = i; e.isTypedArray = s; function v(t) { return ((typeof Promise !== 'undefined' && t instanceof Promise) || (t !== null && typeof t === 'object' && typeof t.then === 'function' && typeof t.catch === 'function')); } e.isPromise = v; function y(t) { if (typeof ArrayBuffer !== 'undefined' && ArrayBuffer.isView) { return ArrayBuffer.isView(t); } return (s(t) || F(t)); } e.isArrayBufferView = y; function m(t) { return o(t) === 'Uint8Array'; } e.isUint8Array = m; function w(t) { return o(t) === 'Uint8ClampedArray'; } e.isUint8ClampedArray = w; function _(t) { return o(t) === 'Uint16Array'; } e.isUint16Array = _; function S(t) { return o(t) === 'Uint32Array'; } e.isUint32Array = S; function E(t) { return o(t) === 'Int8Array'; } e.isInt8Array = E; function x(t) { return o(t) === 'Int16Array'; } e.isInt16Array = x; function M(t) { return o(t) === 'Int32Array'; } e.isInt32Array = M; function T(t) { return o(t) === 'Float32Array'; } e.isFloat32Array = T; function A(t) { return o(t) === 'Float64Array'; } e.isFloat64Array = A; function O(t) { return o(t) === 'BigInt64Array'; } e.isBigInt64Array = O; function k(t) { return o(t) === 'BigUint64Array'; } e.isBigUint64Array = k; function I(t) { return c(t) === '[object Map]'; } I.working = (typeof Map !== 'undefined' && I(new Map())); function R(t) { if (typeof Map === 'undefined') { return false; } return I.working ? I(t) : t instanceof Map; } e.isMap = R; function N(t) { return c(t) === '[object Set]'; } N.working = (typeof Set !== 'undefined' && N(new Set())); function j(t) { if (typeof Set === 'undefined') { return false; } return N.working ? N(t) : t instanceof Set; } e.isSet = j; function P(t) { return c(t) === '[object WeakMap]'; } P.working = (typeof WeakMap !== 'undefined' && P(new WeakMap())); function C(t) { if (typeof WeakMap === 'undefined') { return false; } return P.working ? P(t) : t instanceof WeakMap; } e.isWeakMap = C; function B(t) { return c(t) === '[object WeakSet]'; } B.working = (typeof WeakSet !== 'undefined' && B(new WeakSet())); function L(t) { return B(t); } e.isWeakSet = L; function U(t) { return c(t) === '[object ArrayBuffer]'; } U.working = (typeof ArrayBuffer !== 'undefined' && U(new ArrayBuffer())); function D(t) { if (typeof ArrayBuffer === 'undefined') { return false; } return U.working ? U(t) : t instanceof ArrayBuffer; } e.isArrayBuffer = D; function $(t) { return c(t) === '[object DataView]'; } $.working = (typeof ArrayBuffer !== 'undefined' && typeof DataView !== 'undefined' && $(new DataView(new ArrayBuffer(1), 0, 1))); function F(t) { if (typeof DataView === 'undefined') { return false; } return $.working ? $(t) : t instanceof DataView; } e.isDataView = F; var W = typeof SharedArrayBuffer !== 'undefined' ? SharedArrayBuffer : undefined; function q(t) { return c(t) === '[object SharedArrayBuffer]'; } function z(t) { if (typeof W === 'undefined') { return false; } if (typeof q.working === 'undefined') { q.working = q(new W()); } return q.working ? q(t) : t instanceof W; } e.isSharedArrayBuffer = z; function G(t) { return c(t) === '[object AsyncFunction]'; } e.isAsyncFunction = G; function K(t) { return c(t) === '[object Map Iterator]'; } e.isMapIterator = K; function V(t) { return c(t) === '[object Set Iterator]'; } e.isSetIterator = V; function H(t) { return c(t) === '[object Generator]'; } e.isGeneratorObject = H; function J(t) { return c(t) === '[object WebAssembly.Module]'; } e.isWebAssemblyCompiledModule = J; function X(t) { return b(t, l); } e.isNumberObject = X; function Y(t) { return b(t, h); } e.isStringObject = Y; function Z(t) { return b(t, d); } e.isBooleanObject = Z; function Q(t) { return f && b(t, p); } e.isBigIntObject = Q; function tt(t) { return u && b(t, g); } e.isSymbolObject = tt; function te(t) { return (X(t) || Y(t) || Z(t) || Q(t) || tt(t)); } e.isBoxedPrimitive = te; function tr(t) { return typeof Uint8Array !== 'undefined' && (D(t) || z(t)); } e.isAnyArrayBuffer = tr; [ 'isProxy', 'isExternal', 'isModuleNamespaceObject' ].forEach(function(t) { Object.defineProperty(e, t, { enumerable: false, value: function() { throw new Error(t + ' is not supported in userland'); } }); }); }), 9539: (function(t, e, r) { var n = r(3454); var i = Object.getOwnPropertyDescriptors || function t(e) { var r = Object.keys(e); var n = {}; for(var i = 0; i < r.length; i++){ n[r[i]] = Object.getOwnPropertyDescriptor(e, r[i]); } return n; }; var o = /%[sdj%]/g; e.format = function(t) { if (!x(t)) { var e = []; for(var r = 0; r < arguments.length; r++){ e.push(u(arguments[r])); } return e.join(' '); } var r = 1; var n = arguments; var i = n.length; var s = String(t).replace(o, function(t) { if (t === '%%') return '%'; if (r >= i) return t; switch(t){ case '%s': return String(n[r++]); case '%d': return Number(n[r++]); case '%j': try { return JSON.stringify(n[r++]); } catch (e) { return '[Circular]'; } default: return t; } }); for(var a = n[r]; r < i; a = n[++r]){ if (_(a) || !O(a)) { s += ' ' + a; } else { s += ' ' + u(a); } } return s; }; e.deprecate = function(t, r) { if (typeof n !== 'undefined' && n.noDeprecation === true) { return t; } if (typeof n === 'undefined') { return function() { return e.deprecate(t, r).apply(this, arguments); }; } var i = false; function o() { if (!i) { if (n.throwDeprecation) { throw new Error(r); } else if (n.traceDeprecation) { console.trace(r); } else { console.error(r); } i = true; } return t.apply(this, arguments); } return o; }; var s = {}; var a = /^$/; if (n.env.NODE_DEBUG) { var f = n.env.NODE_DEBUG; f = f.replace(/[|\\{}()[\]^$+?.]/g, '\\$&').replace(/\*/g, '.*').replace(/,/g, '$|^').toUpperCase(); a = new RegExp('^' + f + '$', 'i'); } e.debuglog = function(t) { t = t.toUpperCase(); if (!s[t]) { if (a.test(t)) { var r = n.pid; s[t] = function() { var n = e.format.apply(e, arguments); console.error('%s %d: %s', t, r, n); }; } else { s[t] = function() {}; } } return s[t]; }; function u(t, r) { var n = { seen: [], stylize: l }; if (arguments.length >= 3) n.depth = arguments[2]; if (arguments.length >= 4) n.colors = arguments[3]; if (w(r)) { n.showHidden = r; } else if (r) { e._extend(n, r); } if (T(n.showHidden)) n.showHidden = false; if (T(n.depth)) n.depth = 2; if (T(n.colors)) n.colors = false; if (T(n.customInspect)) n.customInspect = true; if (n.colors) n.stylize = c; return d(n, t, n.depth); } e.inspect = u; u.colors = { 'bold': [ 1, 22 ], 'italic': [ 3, 23 ], 'underline': [ 4, 24 ], 'inverse': [ 7, 27 ], 'white': [ 37, 39 ], 'grey': [ 90, 39 ], 'black': [ 30, 39 ], 'blue': [ 34, 39 ], 'cyan': [ 36, 39 ], 'green': [ 32, 39 ], 'magenta': [ 35, 39 ], 'red': [ 31, 39 ], 'yellow': [ 33, 39 ] }; u.styles = { 'special': 'cyan', 'number': 'yellow', 'boolean': 'yellow', 'undefined': 'grey', 'null': 'bold', 'string': 'green', 'date': 'magenta', 'regexp': 'red' }; function c(t, e) { var r = u.styles[e]; if (r) { return '\u001b[' + u.colors[r][0] + 'm' + t + '\u001b[' + u.colors[r][1] + 'm'; } else { return t; } } function l(t, e) { return t; } function h(t) { var e = {}; t.forEach(function(t, r) { e[t] = true; }); return e; } function d(t, r, n) { if (t.customInspect && r && R(r.inspect) && r.inspect !== e.inspect && !(r.constructor && r.constructor.prototype === r)) { var i = r.inspect(n, t); if (!x(i)) { i = d(t, i, n); } return i; } var o = p(t, r); if (o) { return o; } var s = Object.keys(r); var a = h(s); if (t.showHidden) { s = Object.getOwnPropertyNames(r); } if (I(r) && (s.indexOf('message') >= 0 || s.indexOf('description') >= 0)) { return g(r); } if (s.length === 0) { if (R(r)) { var f = r.name ? ': ' + r.name : ''; return t.stylize('[Function' + f + ']', 'special'); } if (A(r)) { return t.stylize(RegExp.prototype.toString.call(r), 'regexp'); } if (k(r)) { return t.stylize(Date.prototype.toString.call(r), 'date'); } if (I(r)) { return g(r); } } var u = '', c = false, l = [ '{', '}' ]; if (m(r)) { c = true; l = [ '[', ']' ]; } if (R(r)) { var w = r.name ? ': ' + r.name : ''; u = ' [Function' + w + ']'; } if (A(r)) { u = ' ' + RegExp.prototype.toString.call(r); } if (k(r)) { u = ' ' + Date.prototype.toUTCString.call(r); } if (I(r)) { u = ' ' + g(r); } if (s.length === 0 && (!c || r.length == 0)) { return l[0] + u + l[1]; } if (n < 0) { if (A(r)) { return t.stylize(RegExp.prototype.toString.call(r), 'regexp'); } else { return t.stylize('[Object]', 'special'); } } t.seen.push(r); var _; if (c) { _ = b(t, r, n, a, s); } else { _ = s.map(function(e) { return v(t, r, n, a, e, c); }); } t.seen.pop(); return y(_, u, l); } function p(t, e) { if (T(e)) return t.stylize('undefined', 'undefined'); if (x(e)) { var r = '\'' + JSON.stringify(e).replace(/^"|"$/g, '').replace(/'/g, "\\'").replace(/\\"/g, '"') + '\''; return t.stylize(r, 'string'); } if (E(e)) return t.stylize('' + e, 'number'); if (w(e)) return t.stylize('' + e, 'boolean'); if (_(e)) return t.stylize('null', 'null'); } function g(t) { return '[' + Error.prototype.toString.call(t) + ']'; } function b(t, e, r, n, i) { var o = []; for(var s = 0, a = e.length; s < a; ++s){ if (L(e, String(s))) { o.push(v(t, e, r, n, String(s), true)); } else { o.push(''); } } i.forEach(function(i) { if (!i.match(/^\d+$/)) { o.push(v(t, e, r, n, i, true)); } }); return o; } function v(t, e, r, n, i, o) { var s, a, f; f = Object.getOwnPropertyDescriptor(e, i) || { value: e[i] }; if (f.get) { if (f.set) { a = t.stylize('[Getter/Setter]', 'special'); } else { a = t.stylize('[Getter]', 'special'); } } else { if (f.set) { a = t.stylize('[Setter]', 'special'); } } if (!L(n, i)) { s = '[' + i + ']'; } if (!a) { if (t.seen.indexOf(f.value) < 0) { if (_(r)) { a = d(t, f.value, null); } else { a = d(t, f.value, r - 1); } if (a.indexOf('\n') > -1) { if (o) { a = a.split('\n').map(function(t) { return ' ' + t; }).join('\n').substr(2); } else { a = '\n' + a.split('\n').map(function(t) { return ' ' + t; }).join('\n'); } } } else { a = t.stylize('[Circular]', 'special'); } } if (T(s)) { if (o && i.match(/^\d+$/)) { return a; } s = JSON.stringify('' + i); if (s.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { s = s.substr(1, s.length - 2); s = t.stylize(s, 'name'); } else { s = s.replace(/'/g, "\\'").replace(/\\"/g, '"').replace(/(^"|"$)/g, "'"); s = t.stylize(s, 'string'); } } return s + ': ' + a; } function y(t, e, r) { var n = 0; var i = t.reduce(function(t, e) { n++; if (e.indexOf('\n') >= 0) n++; return t + e.replace(/\u001b\[\d\d?m/g, '').length + 1; }, 0); if (i > 60) { return r[0] + (e === '' ? '' : e + '\n ') + ' ' + t.join(',\n ') + ' ' + r[1]; } return r[0] + e + ' ' + t.join(', ') + ' ' + r[1]; } e.types = r(5955); function m(t) { return Array.isArray(t); } e.isArray = m; function w(t) { return typeof t === 'boolean'; } e.isBoolean = w; function _(t) { return t === null; } e.isNull = _; function S(t) { return t == null; } e.isNullOrUndefined = S; function E(t) { return typeof t === 'number'; } e.isNumber = E; function x(t) { return typeof t === 'string'; } e.isString = x; function M(t) { return typeof t === 'symbol'; } e.isSymbol = M; function T(t) { return t === void 0; } e.isUndefined = T; function A(t) { return O(t) && j(t) === '[object RegExp]'; } e.isRegExp = A; e.types.isRegExp = A; function O(t) { return typeof t === 'object' && t !== null; } e.isObject = O; function k(t) { return O(t) && j(t) === '[object Date]'; } e.isDate = k; e.types.isDate = k; function I(t) { return O(t) && (j(t) === '[object Error]' || t instanceof Error); } e.isError = I; e.types.isNativeError = I; function R(t) { return typeof t === 'function'; } e.isFunction = R; function N(t) { return t === null || typeof t === 'boolean' || typeof t === 'number' || typeof t === 'string' || typeof t === 'symbol' || typeof t === 'undefined'; } e.isPrimitive = N; e.isBuffer = r(384); function j(t) { return Object.prototype.toString.call(t); } function P(t) { return t < 10 ? '0' + t.toString(10) : t.toString(10); } var C = [ 'Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec' ]; function B() { var t = new Date(); var e = [ P(t.getHours()), P(t.getMinutes()), P(t.getSeconds()) ].join(':'); return [ t.getDate(), C[t.getMonth()], e ].join(' '); } e.log = function() { console.log('%s - %s', B(), e.format.apply(e, arguments)); }; e.inherits = r(5717); e._extend = function(t, e) { if (!e || !O(e)) return t; var r = Object.keys(e); var n = r.length; while(n--){ t[r[n]] = e[r[n]]; } return t; }; function L(t, e) { return Object.prototype.hasOwnProperty.call(t, e); } var U = typeof Symbol !== 'undefined' ? Symbol('util.promisify.custom') : undefined; e.promisify = function t(e) { if (typeof e !== 'function') throw new TypeError('The "original" argument must be of type Function'); if (U && e[U]) { var r = e[U]; if (typeof r !== 'function') { throw new TypeError('The "util.promisify.custom" argument must be of type Function'); } Object.defineProperty(r, U, { value: r, enumerable: false, writable: false, configurable: true }); return r; } function r() { var t, r; var n = new Promise(function(e, n) { t = e; r = n; }); var i = []; for(var o = 0; o < arguments.length; o++){ i.push(arguments[o]); } i.push(function(e, n) { if (e) { r(e); } else { t(n); } }); try { e.apply(this, i); } catch (s) { r(s); } return n; } Object.setPrototypeOf(r, Object.getPrototypeOf(e)); if (U) Object.defineProperty(r, U, { value: r, enumerable: false, writable: false, configurable: true }); return Object.defineProperties(r, i(e)); }; e.promisify.custom = U; function D(t, e) { if (!t) { var r = new Error('Promise was rejected with a falsy value'); r.reason = t; t = r; } return e(t); } function $(t) { if (typeof t !== 'function') { throw new TypeError('The "original" argument must be of type Function'); } function e() { var e = []; for(var r = 0; r < arguments.length; r++){ e.push(arguments[r]); } var i = e.pop(); if (typeof i !== 'function') { throw new TypeError('The last argument must be of type Function'); } var o = this; var s = function() { return i.apply(o, arguments); }; t.apply(this, e).then(function(t) { n.nextTick(s.bind(null, null, t)); }, function(t) { n.nextTick(D.bind(null, t, s)); }); } Object.setPrototypeOf(e, Object.getPrototypeOf(t)); Object.defineProperties(e, i(t)); return e; } e.callbackify = $; }), 345: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.SortKeyCacheResult = e.CacheKey = void 0; class r { constructor(t, e){ this.contractTxId = t; this.sortKey = e; } } e.CacheKey = r; class n { constructor(t, e){ this.sortKey = t; this.cachedValue = e; } } e.SortKeyCacheResult = n; }), 7563: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.LevelDbCache = void 0; const n = r(3145); const i = r(1271); const o = r(5913); class s { constructor(t){ this.logger = o.LoggerFactory.INST.create('LevelDbCache'); if (t.inMemory) { this.db = new i.MemoryLevel({ valueEncoding: 'json' }); } else { if (!t.dbLocation) { throw new Error('LevelDb cache configuration error - no db location specified'); } const e = t.dbLocation; this.logger.info(`Using location ${e}`); this.db = new n.Level(e, { valueEncoding: 'json' }); } } async get(t, e, r) { const n = this.db.sublevel(t, { valueEncoding: 'json' }); try { const i = await n.get(e); return { sortKey: e, cachedValue: i }; } catch (o) { if (o.code == 'LEVEL_NOT_FOUND') { return null; } else { throw o; } } } async getLast(t) { const e = this.db.sublevel(t, { valueEncoding: 'json' }); const r = await e.keys({ reverse: true, limit: 1 }).all(); if (r.length) { return { sortKey: r[0], cachedValue: await e.get(r[0]) }; } else { return null; } } async getLessOrEqual(t, e) { const r = this.db.sublevel(t, { valueEncoding: 'json' }); const n = await r.keys({ reverse: true, lte: e, limit: 1 }).all(); if (n.length) { return { sortKey: n[0], cachedValue: await r.get(n[0]) }; } else { return null; } } async put(t, e) { const r = this.db.sublevel(t.contractTxId, { valueEncoding: 'json' }); await r.open(); await r.put(t.sortKey, e); } close() { return this.db.close(); } async dump() { const t = await this.db.iterator().all(); return t; } async getLastSortKey() { let t = ''; const e = await this.db.keys().all(); for (const r of e){ const n = r.substring(45); if (n.localeCompare(t) > 0) { t = n; } } return t == '' ? null : t; } async allContracts() { const t = await this.db.keys().all(); const e = new Set(); t.forEach((t)=>e.add(t.substring(1, 44))); return Array.from(e); } } e.LevelDbCache = s; }), 1200: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.MemCache = void 0; class r { constructor(){ this.storage = {}; } clearAll() { Object.keys(this.storage).forEach((t)=>{ delete this.storage[t]; }); } contains(t) { return Object.prototype.hasOwnProperty.call(this.storage, t); } get(t) { return this.storage[t]; } put(t, e) { this.storage[t] = e; } remove(t) { delete this.storage[t]; } } e.MemCache = r; }), 8469: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 9692: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; var s = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.HandlerBasedContract = void 0; const a = s(r(7668)); const f = o(r(1087)); const u = r(5614); const c = r(1967); const l = r(7462); const h = r(7312); const d = r(40); const p = r(9106); const g = r(5913); const b = r(2491); const v = r(9360); const y = r(5082); const m = r(3611); const w = r(4217); const _ = r(8102); class S { constructor(t, e, r = null, n = null){ this._contractTxId = t; this.warp = e; this._parentContract = r; this._callingInteraction = n; this.logger = g.LoggerFactory.INST.create('HandlerBasedContract'); this._evaluationOptions = new l.DefaultEvaluationOptions(); this._innerWritesEvaluator = new _.InnerWritesEvaluator(); this._benchmarkStats = null; this.waitForConfirmation = this.waitForConfirmation.bind(this); this._arweaveWrapper = new v.ArweaveWrapper(e.arweave); this._sorter = new c.LexicographicalInteractionsSorter(e.arweave); if (r != null) { this._evaluationOptions = r.evaluationOptions(); this._callDepth = r.callDepth() + 1; const i = r.getCallStack().getInteraction(n.id); if (this._callDepth > this._evaluationOptions.maxCallDepth) { throw Error(`Max call depth of ${this._evaluationOptions.maxCallDepth} has been exceeded for interaction ${JSON.stringify(i.interactionInput)}`); } this.logger.debug('Calling interaction', { id: n.id, sortKey: n.sortKey }); const o = new u.ContractCallStack(t, this._callDepth); i.interactionInput.foreignContractCalls.set(t, o); this._callStack = o; this._rootSortKey = r.rootSortKey; } else { this._callDepth = 0; this._callStack = new u.ContractCallStack(t, 0); this._rootSortKey = null; } } async readState(t, e, r) { var n, i, o; this.logger.info('Read state for', { contractTxId: this._contractTxId, currentTx: e, sortKeyOrBlockHeight: t }); const s = p.Benchmark.measure(); this.maybeResetRootContract(); if (this._parentContract != null && t == null) { throw new Error('SortKey MUST be always set for non-root contract calls'); } const { stateEvaluator: a } = this.warp; const f = typeof t == 'number' ? this._sorter.generateLastSortKey(t) : t; const u = await this.createExecutionContext(this._contractTxId, f, false, r); this.logger.info('Execution Context', { srcTxId: (n = u.contractDefinition) === null || n === void 0 ? void 0 : n.srcTxId, missingInteractions: (i = u.sortedInteractions) === null || i === void 0 ? void 0 : i.length, cachedSortKey: (o = u.cachedState) === null || o === void 0 ? void 0 : o.sortKey }); s.stop(); const c = p.Benchmark.measure(); const l = await a.eval(u, e || []); c.stop(); const h = s.elapsed(true) + c.elapsed(true); this._benchmarkStats = { gatewayCommunication: s.elapsed(true), stateEvaluation: c.elapsed(true), total: h }; this.logger.info('Benchmark', { 'Gateway communication ': s.elapsed(), 'Contract evaluation ': c.elapsed(), 'Total: ': `${h.toFixed(0)}ms` }); return l; } async viewState(t, e = [], r = m.emptyTransfer) { this.logger.info('View state for', this._contractTxId); return await this.callContract(t, undefined, undefined, e, r); } async viewStateForTx(t, e) { this.logger.info(`View state for ${this._contractTxId}`, e); return await this.callContractForTx(t, e); } async dryWrite(t, e, r, n) { this.logger.info('Dry-write for', this._contractTxId); return await this.callContract(t, e, undefined, r, n); } async dryWriteFromTx(t, e, r) { this.logger.info(`Dry-write from transaction ${e.id} for ${this._contractTxId}`); return await this.callContractForTx(t, e, r || []); } async writeInteraction(t, e) { this.logger.info('Write interaction', { input: t, options: e }); if (!this.signer) { throw new Error("Wallet not connected. Use 'connect' method first."); } const { arweave: r , interactionsLoader: n } = this.warp; const i = (e === null || e === void 0 ? void 0 : e.tags) || []; const o = (e === null || e === void 0 ? void 0 : e.transfer) || m.emptyTransfer; const s = (e === null || e === void 0 ? void 0 : e.strict) === true; const a = (e === null || e === void 0 ? void 0 : e.vrf) === true; const f = (e === null || e === void 0 ? void 0 : e.disableBundling) === true; const u = e === null || e === void 0 ? void 0 : e.reward; const c = n.type() == 'warp' && !f; if (c && o.target != m.emptyTransfer.target && o.winstonQty != m.emptyTransfer.winstonQty) { throw new Error('Ar Transfers are not allowed for bundled interactions'); } if (a && !c) { throw new Error('Vrf generation is only available for bundle interaction'); } if (c) { return await this.bundleInteraction(t, { tags: i, strict: s, vrf: a }); } else { const l = await this.createInteraction(t, i, o, s, false, false, u); const h = await r.transactions.post(l); if (h.status !== 200) { this.logger.error('Error while posting transaction', h); return null; } if (this._evaluationOptions.waitForConfirmation) { this.logger.info('Waiting for confirmation of', l.id); const d = p.Benchmark.measure(); await this.waitForConfirmation(l.id); this.logger.info('Transaction confirmed after', d.elapsed()); } if (this.warp.environment == 'local' && this._evaluationOptions.mineArLocalBlocks) { await this.warp.testing.mineBlock(); } return { originalTxId: l.id }; } } async bundleInteraction(t, e) { this.logger.info('Bundle interaction input', t); const r = await this.createInteraction(t, e.tags, m.emptyTransfer, e.strict, true, e.vrf); const n = await fetch(`${this._evaluationOptions.bundlerUrl}gateway/sequencer/register`, { method: 'POST', body: JSON.stringify(r), headers: { 'Accept-Encoding': 'gzip, deflate, br', 'Content-Type': 'application/json', Accept: 'application/json' } }).then((t)=>{ this.logger.debug(t); return t.ok ? t.json() : Promise.reject(t); }).catch((t)=>{ var e; this.logger.error(t); if ((e = t.body) === null || e === void 0 ? void 0 : e.message) { this.logger.error(t.body.message); } throw new Error(`Unable to bundle interaction: ${JSON.stringify(t)}`); }); return { bundlrResponse: n, originalTxId: r.id }; } async createInteraction(t, e, r, n, i = false, o = false, s) { if (this._evaluationOptions.internalWrites) { const a = await this.callContract(t, undefined, undefined, e, r); if (n && a.type !== 'ok') { throw Error(`Cannot create interaction: ${a.errorMessage}`); } const f = this.getCallStack(); const u = this._innerWritesEvaluator.eval(f); this.logger.debug('Input', t); this.logger.debug('Callstack', f.print()); u.forEach((t)=>{ e.push({ name: h.SmartWeaveTags.INTERACT_WRITE, value: t }); }); this.logger.debug('Tags with inner calls', e); } else { if (n) { const c = await this.callContract(t, undefined, undefined, e, r); if (c.type !== 'ok') { throw Error(`Cannot create interaction: ${c.errorMessage}`); } } } if (o) { e.push({ name: h.SmartWeaveTags.REQUEST_VRF, value: 'true' }); } const l = await (0, d.createInteractionTx)(this.warp.arweave, this.signer, this._contractTxId, t, e, r.target, r.winstonQty, i, s); return l; } txId() { return this._contractTxId; } getCallStack() { return this._callStack; } connect(t) { if (typeof t == 'function') { this.signer = t; } else { this.signer = async (e)=>{ await this.warp.arweave.transactions.sign(e, t); }; } return this; } setEvaluationOptions(t) { this._evaluationOptions = { ...this._evaluationOptions, ...t }; return this; } async waitForConfirmation(t) { const { arweave: e } = this.warp; const r = await e.transactions.getStatus(t); if (r.confirmed === null) { this.logger.info(`Transaction ${t} not yet confirmed. Waiting another 20 seconds before next check.`); await (0, y.sleep)(20000); await this.waitForConfirmation(t); } else { this.logger.info(`Transaction ${t} confirmed`, r); return r; } } async createExecutionContext(t, e, r = false, n) { var i; const { definitionLoader: o , interactionsLoader: s , executorFactory: a , stateEvaluator: f } = this.warp; const u = p.Benchmark.measure(); const c = await f.latestAvailableState(t, e); this.logger.debug('cache lookup', u.elapsed()); u.reset(); const l = b.Evolve.evolvedSrcTxId((i = c === null || c === void 0 ? void 0 : c.cachedValue) === null || i === void 0 ? void 0 : i.state); let h, d, g; this.logger.debug('Cached state', c, e); if (c && c.sortKey == e) { this.logger.debug('State fully cached, not loading interactions.'); if (r || l) { d = await o.load(t, l); h = (await a.create(d, this._evaluationOptions)); } } else { [d, g] = await Promise.all([ o.load(t, l), n ? Promise.resolve(n) : await s.load(t, c === null || c === void 0 ? void 0 : c.sortKey, this.getToSortKey(e), this._evaluationOptions) ]); if (c === null || c === void 0 ? void 0 : c.sortKey) { g = g.filter((t)=>t.sortKey.localeCompare(c === null || c === void 0 ? void 0 : c.sortKey) > 0); } if (e) { g = g.filter((t)=>t.sortKey.localeCompare(e) <= 0); } this.logger.debug('contract and interactions load', u.elapsed()); if (this._parentContract == null && g.length) { this._rootSortKey = g[g.length - 1].sortKey; } h = (await a.create(d, this._evaluationOptions)); } return { warp: this.warp, contract: this, contractDefinition: d, sortedInteractions: g, evaluationOptions: this._evaluationOptions, handler: h, cachedState: c, requestedSortKey: e }; } getToSortKey(t) { var e; if ((e = this._parentContract) === null || e === void 0 ? void 0 : e.rootSortKey) { if (!t) { return this._parentContract.rootSortKey; } return this._parentContract.rootSortKey.localeCompare(t) > 0 ? this._parentContract.rootSortKey : t; } else { return t; } } async createExecutionContextFromTx(t, e) { const r = e.owner.address; const n = e.sortKey; const i = await this.createExecutionContext(t, n, true); return { ...i, caller: r }; } maybeResetRootContract() { if (this._parentContract == null) { this.logger.debug('Clearing call stack for the root contract'); this._callStack = new u.ContractCallStack(this.txId(), 0); this._rootSortKey = null; this.warp.interactionsLoader.clearCache(); } } async callContract(t, e, r, n = [], i = m.emptyTransfer) { this.logger.info('Call contract input', t); this.maybeResetRootContract(); if (!this.signer) { this.logger.warn('Wallet not set.'); } const { arweave: o , stateEvaluator: s } = this.warp; let a = await this.createExecutionContext(this._contractTxId, r, true); const f = this.warp.environment == 'mainnet' ? await this._arweaveWrapper.warpGwBlock() : await o.blocks.getCurrent(); let u; if (e) { u = e; } else if (this.signer) { const c = await o.createTransaction({ data: Math.random().toString().slice(-4), reward: '72600854', last_tx: 'p7vc1iSP6bvH_fCeUFa9LqoV5qiyW-jdEKouAT0XMoSwrNraB9mgpi29Q10waEpO' }); await this.signer(c); u = await o.wallets.ownerToAddress(c.owner); } else { u = ''; } this.logger.info('effectiveCaller', u); a = { ...a, caller: u }; const l = await s.eval(a, []); this.logger.info('Current state', l.cachedValue.state); const h = { input: t, caller: a.caller }; this.logger.debug('interaction', h); const p = await (0, d.createInteractionTx)(o, this.signer, this._contractTxId, t, n, i.target, i.winstonQty, true); const g = (0, d.createDummyTx)(p, a.caller, f); this.logger.debug('Creating sortKey for', { blockId: g.block.id, id: g.id, height: g.block.height }); g.sortKey = await this._sorter.createSortKey(g.block.id, g.id, g.block.height, true); const b = await this.evalInteraction({ interaction: h, interactionTx: g, currentTx: [] }, a, l.cachedValue); if (b.type !== 'ok') { this.logger.fatal('Error while interacting with contract', { type: b.type, error: b.errorMessage }); } return b; } async callContractForTx(t, e, r) { this.maybeResetRootContract(); const n = await this.createExecutionContextFromTx(this._contractTxId, e); const i = await this.warp.stateEvaluator.eval(n, r); this.logger.debug('callContractForTx - evalStateResult', { result: i.cachedValue.state, txId: this._contractTxId }); const o = { input: t, caller: this._parentContract.txId() }; const s = { interaction: o, interactionTx: e, currentTx: r }; const a = await this.evalInteraction(s, n, i.cachedValue); a.originalValidity = i.cachedValue.validity; a.originalErrorMessages = i.cachedValue.errorMessages; return a; } async evalInteraction(t, e, r) { const n = this.getCallStack().addInteractionData(t); const i = p.Benchmark.measure(); const o = await e.handler.handle(e, r, t); n.update({ cacheHit: false, outputState: this._evaluationOptions.stackTrace.saveState ? o.state : undefined, executionTime: i.elapsed(true), valid: o.type === 'ok', errorMessage: o.errorMessage, gasUsed: o.gasUsed }); return o; } parent() { return this._parentContract; } callDepth() { return this._callDepth; } evaluationOptions() { return this._evaluationOptions; } lastReadStateStats() { return this._benchmarkStats; } stateHash(t) { const e = (0, a.default)(t); const r = f.createHash('sha256'); r.update(e); return r.digest('hex'); } async syncState(t, e) { const { stateEvaluator: r } = this.warp; const n = await fetch(`${t}?${new URLSearchParams({ id: this._contractTxId, ...e })}`).then((t)=>{ return t.ok ? t.json() : Promise.reject(t); }).catch((t)=>{ var e, r; if ((e = t.body) === null || e === void 0 ? void 0 : e.message) { this.logger.error(t.body.message); } throw new Error(`Unable to retrieve state. ${t.status}: ${(r = t.body) === null || r === void 0 ? void 0 : r.message}`); }); await r.syncState(this._contractTxId, n.sortKey, n.state, n.validity); return this; } async evolve(t, e) { return await this.writeInteraction({ function: 'evolve', value: t }, e); } async save(t) { if (!this.signer) { throw new Error("Wallet not connected. Use 'connect' method first."); } const { arweave: e } = this.warp; const r = new w.SourceImpl(e); const n = await r.save(t, this.signer); return n.id; } get callingInteraction() { return this._callingInteraction; } get rootSortKey() { return this._rootSortKey; } } e.HandlerBasedContract = S; }), 8102: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.InnerWritesEvaluator = void 0; class r { eval(t) { const e = []; t.interactions.forEach((r)=>{ this.evalForeignCalls(t.contractTxId, r, e); }); return e; } evalForeignCalls(t, e, r) { e.interactionInput.foreignContractCalls.forEach((e)=>{ e.interactions.forEach((n)=>{ if (n.interactionInput.dryWrite && !r.includes(e.contractTxId) && t !== e.contractTxId) { r.push(e.contractTxId); } this.evalForeignCalls(t, n, r); }); }); } } e.InnerWritesEvaluator = r; }), 7665: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 7819: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.PstContractImpl = void 0; const n = r(9692); class i extends n.HandlerBasedContract { async currentBalance(t) { const e = await this.viewState({ function: 'balance', target: t }); if (e.type !== 'ok') { throw Error(e.errorMessage); } return e.result; } async currentState() { return (await super.readState()).cachedValue.state; } async transfer(t, e) { return await this.writeInteraction({ function: 'transfer', ...t }, e); } } e.PstContractImpl = i; }), 3611: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.emptyTransfer = void 0; e.emptyTransfer = { target: '', winstonQty: '0' }; }), 4722: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 5731: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.DefaultCreateContract = void 0; const n = r(7312); const i = r(8479); const o = r(5913); const s = r(4217); class a { constructor(t, e){ this.arweave = t; this.warp = e; this.logger = o.LoggerFactory.INST.create('DefaultCreateContract'); this.deployFromSourceTx = this.deployFromSourceTx.bind(this); } async deploy(t, e) { const { wallet: r , initState: n , tags: i , transfer: o , data: a } = t; const f = e == undefined ? this.warp.definitionLoader.type() == 'warp' : !e; const u = new s.SourceImpl(this.arweave); const c = await u.save(t, r, f); this.logger.debug('Creating new contract'); return await this.deployFromSourceTx({ srcTxId: c.id, wallet: r, initState: n, tags: i, transfer: o, data: a }, !f, c); } async deployFromSourceTx(t, e, r = null) { this.logger.debug('Creating new contract from src tx'); const { wallet: i , srcTxId: o , initState: s , tags: a , transfer: f , data: u } = t; const c = e == undefined ? this.warp.definitionLoader.type() == 'warp' : !e; let l = await this.arweave.createTransaction({ data: (u === null || u === void 0 ? void 0 : u.body) || s }, i); if (+(f === null || f === void 0 ? void 0 : f.winstonQty) > 0 && f.target.length) { this.logger.debug('Creating additional transaction with AR transfer', f); l = await this.arweave.createTransaction({ data: (u === null || u === void 0 ? void 0 : u.body) || s, target: f.target, quantity: f.winstonQty }, i); } if (a === null || a === void 0 ? void 0 : a.length) { for (const h of a){ l.addTag(h.name.toString(), h.value.toString()); } } l.addTag(n.SmartWeaveTags.APP_NAME, 'SmartWeaveContract'); l.addTag(n.SmartWeaveTags.APP_VERSION, '0.3.0'); l.addTag(n.SmartWeaveTags.CONTRACT_SRC_TX_ID, o); l.addTag(n.SmartWeaveTags.SDK, 'RedStone'); if (u) { l.addTag(n.SmartWeaveTags.CONTENT_TYPE, u['Content-Type']); l.addTag(n.SmartWeaveTags.INIT_STATE, s); } else { l.addTag(n.SmartWeaveTags.CONTENT_TYPE, 'application/json'); } await this.arweave.transactions.sign(l, i); let d; let p; if (c) { const g = await this.post(l, r); this.logger.debug(g); d = true; } else { p = await this.arweave.transactions.post(l); d = p.status === 200 || p.status === 208; } if (d) { return { contractTxId: l.id, srcTxId: o }; } else { throw new Error(`Unable to write Contract. Arweave responded with status ${p.status}: ${p.statusText}`); } } async post(t, e = null) { let r = { contractTx: t }; if (e) { r = { ...r, srcTx: e }; } const n = await fetch(`${i.WARP_GW_URL}/gateway/contracts/deploy`, { method: 'POST', body: JSON.stringify(r), headers: { 'Accept-Encoding': 'gzip, deflate, br', 'Content-Type': 'application/json', Accept: 'application/json' } }); if (n.ok) { return n.json(); } else { throw new Error(`Error while posting contract. Sequencer responded with status ${n.status} ${n.statusText}`); } } } e.DefaultCreateContract = a; }), 4217: (function(t, e, r) { "use strict"; var n = r(8764)["Buffer"]; var i = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.SourceImpl = void 0; const o = i(r(8060)); const s = r(7170); const a = i(r(9827)); const f = r(4742); const u = r(7312); const c = r(5913); const l = new Map([ [ 1, 'assemblyscript' ], [ 2, 'rust' ], [ 3, 'go' ] ]); class h { constructor(t){ this.arweave = t; this.logger = c.LoggerFactory.INST.create('Source'); } async save(t, e, r = false) { this.logger.debug('Creating new contract source'); const { src: i , wasmSrcCodeDir: c , wasmGlueCode: h } = t; const p = i instanceof n ? 'wasm' : 'js'; let g; let b = null; let v = null; const y = {}; const m = []; if (p == 'wasm') { const w = o.default.meterWASM(i, { meterType: 'i32' }); m.push(w); const _ = await WebAssembly.compile(i); const S = WebAssembly.Module.imports(_); let E; if (this.isGoModule(S)) { const x = new s.Go(null); const M = new WebAssembly.Instance(_, x.importObject); x.run(M); E = x.exports.lang(); v = x.exports.version(); } else { const T = await WebAssembly.instantiate(i, d(S)); if (!T.instance.exports.lang) { throw new Error(`No info about source type in wasm binary. Did you forget to export "lang" function?`); } E = T.instance.exports.lang(); v = T.instance.exports.version(); if (!l.has(E)) { throw new Error(`Unknown wasm source type ${E}`); } } b = l.get(E); if (c == null) { throw new Error('No path to original wasm contract source code'); } const A = await this.zipContents(c); m.push(A); if (b == 'rust') { if (!h) { throw new Error('No path to generated wasm-bindgen js code'); } const O = a.default.readFileSync(h, 'utf-8'); const k = (0, f.matchMutClosureDtor)(O); y['dtor'] = parseInt(k); m.push(n.from(O)); } } const I = p == 'wasm' ? this.joinBuffers(m) : i; if (typeof e == 'function') { g = await this.arweave.createTransaction({ data: I }); } else { g = await this.arweave.createTransaction({ data: I }, e); } g.addTag(u.SmartWeaveTags.APP_NAME, 'SmartWeaveContractSource'); g.addTag(u.SmartWeaveTags.APP_VERSION, '0.3.0'); g.addTag(u.SmartWeaveTags.SDK, 'Warp'); g.addTag(u.SmartWeaveTags.CONTENT_TYPE, p == 'js' ? 'application/javascript' : 'application/wasm'); if (p == 'wasm') { g.addTag(u.SmartWeaveTags.WASM_LANG, b); g.addTag(u.SmartWeaveTags.WASM_LANG_VERSION, v); g.addTag(u.SmartWeaveTags.WASM_META, JSON.stringify(y)); } if (typeof e == 'function') { await e(g); } else { await this.arweave.transactions.sign(g, e); } this.logger.debug('Posting transaction with source'); let R = true; let N; if (!r) { N = await this.arweave.transactions.post(g); R = N.status === 200 || N.status === 208; } if (R) { return g; } else { throw new Error(`Unable to write Contract Source. Arweave responded with status ${N.status}: ${N.statusText}`); } } isGoModule(t) { return t.some((t)=>{ return t.module == 'env' && t.name.startsWith('syscall/js'); }); } joinBuffers(t) { const e = t.length; const r = []; r.push(n.from(e.toString())); r.push(n.from('|')); t.forEach((t)=>{ r.push(n.from(t.length.toString())); r.push(n.from('|')); }); r.push(...t); return r.reduce((t, e)=>n.concat([ t, e ])); } async zipContents(t) { const e = r(1445), n = r(4034); const i = new n.WritableStreamBuffer({ initialSize: 1000 * 1024, incrementAmount: 1000 * 1024 }); const o = e('zip', { zlib: { level: 9 } }); o.on('error', function(t) { throw t; }); o.pipe(i); o.directory(t.toString(), t.toString()); await o.finalize(); i.end(); return i.getContents(); } } e.SourceImpl = h; function d(t) { const e = {}; t.forEach((t)=>{ if (!Object.prototype.hasOwnProperty.call(e, t.module)) { e[t.module] = {}; } e[t.module][t.name] = function() {}; }); return e; } }), 3667: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.MigrationTool = void 0; const i = r(1967); const o = r(7462); const s = n(r(771)); const a = r(5913); class f { constructor(t, e){ this.arweave = t; this.levelDb = e; this.logger = a.LoggerFactory.INST.create('MigrationTool'); this.sorter = new i.LexicographicalInteractionsSorter(t); } async migrateSqlite(t) { this.logger.info(`Migrating from sqlite ${t} to leveldb.`); const e = (0, s.default)({ client: 'sqlite3', connection: { filename: t }, useNullAsDefault: true }); const r = await e.select([ 'contract_id', 'height', 'state' ]).from('states').max('height').groupBy([ 'contract_id' ]); this.logger.info(`Migrating ${r === null || r === void 0 ? void 0 : r.length} contracts' state`); const n = []; for (const i of r){ const a = i['contract_id']; const f = i['height']; const u = JSON.parse(i['state']); const c = this.sorter.generateLastSortKey(parseInt(f)); this.logger.debug(`Migrating ${a} at height ${f}: ${c}`); await this.levelDb.put({ contractTxId: a, sortKey: c }, new o.EvalStateResult(u.state, u.validity, {})); n.push({ contractTxId: a, height: f, sortKey: c }); } this.logger.info(`Migration done.`); return n; } } e.MigrationTool = f; }), 4464: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.Testing = void 0; class r { constructor(t){ this.arweave = t; } async mineBlock() { this.validateEnv(); await this.arweave.api.get('mine'); } async generateWallet() { this.validateEnv(); const t = await this.arweave.wallets.generate(); await this.addFunds(t); return t; } async addFunds(t) { const e = await this.arweave.wallets.getAddress(t); await this.arweave.api.get(`/mint/${e}/1000000000000000`); } validateEnv() { if (this.arweave.api.getConfig().host.includes('arweave')) { throw new Error('Testing features are not available in a non testing environment'); } } } e.Testing = r; }), 5614: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.InteractionOutput = e.InteractionInput = e.InteractionCall = e.ContractCallStack = void 0; const n = r(5082); class i { constructor(t, e, r = ''){ this.contractTxId = t; this.depth = e; this.label = r; this.interactions = new Map(); } addInteractionData(t) { const { interaction: e , interactionTx: r } = t; const n = o.create(new s(r.id, r.sortKey, r.block.height, r.block.timestamp, e === null || e === void 0 ? void 0 : e.caller, e === null || e === void 0 ? void 0 : e.input.function, e === null || e === void 0 ? void 0 : e.input, r.dry, new Map())); this.interactions.set(r.id, n); return n; } getInteraction(t) { return this.interactions.get(t); } print() { return JSON.stringify(this, n.mapReplacer); } } e.ContractCallStack = i; class o { constructor(t){ this.interactionInput = t; } static create(t) { return new o(t); } update(t) { this.interactionOutput = t; } } e.InteractionCall = o; class s { constructor(t, e, r, n, i, o, s, a, f = new Map()){ this.txId = t; this.sortKey = e; this.blockHeight = r; this.blockTimestamp = n; this.caller = i; this.functionName = o; this.functionArguments = s; this.dryWrite = a; this.foreignContractCalls = f; } } e.InteractionInput = s; class a { constructor(t, e, r, n, i = '', o){ this.cacheHit = t; this.outputState = e; this.executionTime = r; this.valid = n; this.errorMessage = i; this.gasUsed = o; } } e.InteractionOutput = a; }), 9305: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.ContractMetadata = void 0; class r { } e.ContractMetadata = r; }), 4805: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 8632: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 7312: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.SmartWeaveTags = void 0; var r; (function(t) { t["APP_NAME"] = "App-Name"; t["APP_VERSION"] = "App-Version"; t["CONTRACT_TX_ID"] = "Contract"; t["INPUT"] = "Input"; t["CONTENT_TYPE"] = "Content-Type"; t["CONTRACT_SRC_TX_ID"] = "Contract-Src"; t["SDK"] = "SDK"; t["MIN_FEE"] = "Min-Fee"; t["INIT_STATE"] = "Init-State"; t["INIT_STATE_TX"] = "Init-State-TX"; t["INTERACT_WRITE"] = "Interact-Write"; t["WASM_LANG"] = "Wasm-Lang"; t["WASM_LANG_VERSION"] = "Wasm-Lang-Version"; t["WASM_META"] = "Wasm-Meta"; t["REQUEST_VRF"] = "Request-Vrf"; })(r = e.SmartWeaveTags || (e.SmartWeaveTags = {})); }), 2009: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.Warp = void 0; const n = r(5731); const i = r(9692); const o = r(7819); const s = r(3667); const a = r(4464); const f = r(9689); class u { constructor(t, e, r, i, o, f, u = 'custom'){ this.arweave = t; this.levelDb = e; this.definitionLoader = r; this.interactionsLoader = i; this.executorFactory = o; this.stateEvaluator = f; this.environment = u; this.createContract = new n.DefaultCreateContract(t, this); this.migrationTool = new s.MigrationTool(t, e); this.testing = new a.Testing(t); } static builder(t, e, r) { return new f.WarpBuilder(t, e, r); } contract(t, e, r) { return new i.HandlerBasedContract(t, this, e, r); } pst(t) { return new o.PstContractImpl(t, this); } } e.Warp = u; }), 9689: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.WarpBuilder = void 0; const n = r(1200); const i = r(4481); const o = r(9564); const s = r(7346); const a = r(7089); const f = r(3187); const u = r(1533); const c = r(2009); class l { constructor(t, e, r = 'custom'){ this._arweave = t; this._cache = e; this._environment = r; } setDefinitionLoader(t) { this._definitionLoader = t; return this; } setInteractionsLoader(t) { this._interactionsLoader = t; return this; } setExecutorFactory(t) { this._executorFactory = t; return this; } setStateEvaluator(t) { this._stateEvaluator = t; return this; } overwriteSource(t) { if (this._executorFactory == null) { throw new Error('Set base ExecutorFactory first'); } this._executorFactory = new i.DebuggableExecutorFactory(this._executorFactory, t); return this.build(); } useWarpGateway(t) { this._interactionsLoader = new s.CacheableInteractionsLoader(new u.WarpGatewayInteractionsLoader(t.address, t.confirmationStatus, t.source)); this._definitionLoader = new f.WarpGatewayContractDefinitionLoader(t.address, this._arweave, new n.MemCache()); return this; } useArweaveGateway() { this._definitionLoader = new a.ContractDefinitionLoader(this._arweave, new n.MemCache()); this._interactionsLoader = new s.CacheableInteractionsLoader(new o.ArweaveGatewayInteractionsLoader(this._arweave)); return this; } build() { return new c.Warp(this._arweave, this._cache, this._definitionLoader, this._interactionsLoader, this._executorFactory, this._stateEvaluator, this._environment); } } e.WarpBuilder = l; }), 8479: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.WarpFactory = e.defaultCacheOptions = e.DEFAULT_LEVEL_DB_LOCATION = e.defaultWarpGwOptions = e.WARP_GW_URL = void 0; const i = n(r(7386)); const o = r(7563); const s = r(1200); const a = r(7794); const f = r(2491); const u = r(4286); const c = r(9174); const l = r(2009); e.WARP_GW_URL = 'https://d1o5nlqr4okus2.cloudfront.net'; e.defaultWarpGwOptions = { confirmationStatus: { notCorrupted: true }, source: null, address: e.WARP_GW_URL }; e.DEFAULT_LEVEL_DB_LOCATION = './cache/warp'; e.defaultCacheOptions = { inMemory: false, dbLocation: e.DEFAULT_LEVEL_DB_LOCATION }; class h { static forLocal(t = 1984, r = i.default.init({ host: 'localhost', port: t, protocol: 'http' }), n = { ...e.defaultCacheOptions, inMemory: true }) { return this.customArweaveGw(r, n, 'local'); } static forTestnet(t = i.default.init({ host: 'testnet.redstone.tools', port: 443, protocol: 'https' }), r = e.defaultCacheOptions) { return this.customArweaveGw(t, r, 'testnet'); } static forMainnet(t = e.defaultCacheOptions, r = false, n = i.default.init({ host: 'arweave.net', port: 443, protocol: 'https' })) { if (r) { return this.customArweaveGw(n, t, 'mainnet'); } else { console.log(e.defaultWarpGwOptions); return this.customWarpGw(n, e.defaultWarpGwOptions, t, 'mainnet'); } } static custom(t, e, r) { const n = new o.LevelDbCache({ ...e, dbLocation: `${e.dbLocation}/state` }); const i = new a.CacheableExecutorFactory(t, new c.HandlerExecutorFactory(t), new s.MemCache()); const h = new u.CacheableStateEvaluator(t, n, [ new f.Evolve() ]); return l.Warp.builder(t, n, r).setExecutorFactory(i).setStateEvaluator(h); } static customArweaveGw(t, r = e.defaultCacheOptions, n) { return this.custom(t, r, n).useArweaveGateway().build(); } static customWarpGw(t, r = e.defaultWarpGwOptions, n = e.defaultCacheOptions, i) { return this.custom(t, n, i).useWarpGateway(r).build(); } } e.WarpFactory = h; }), 2656: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 5368: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 5765: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 6769: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 7462: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.DefaultEvaluationOptions = e.EvalStateResult = void 0; class r { constructor(t, e, r){ this.state = t; this.validity = e; this.errorMessages = r; } } e.EvalStateResult = r; class n { constructor(){ this.ignoreExceptions = true; this.waitForConfirmation = false; this.updateCacheForEachInteraction = false; this.internalWrites = false; this.maxCallDepth = 7; this.maxInteractionEvaluationTimeSeconds = 60; this.stackTrace = { saveState: false }; this.bundlerUrl = `https://d1o5nlqr4okus2.cloudfront.net/`; this.gasLimit = Number.MAX_SAFE_INTEGER; this.useFastCopy = true; this.useVM2 = false; this.allowUnsafeClient = false; this.allowBigInt = false; this.walletBalanceUrl = 'http://nyc-1.dev.arweave.net:1984/'; this.mineArLocalBlocks = true; } } e.DefaultEvaluationOptions = n; }), 9564: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.ArweaveGatewayInteractionsLoader = e.bundledTxsFilter = void 0; const n = r(7312); const i = r(9106); const o = r(5913); const s = r(9360); const a = r(5082); const f = r(1967); const u = 100; function c(t) { var e, r; return !((e = t.node.parent) === null || e === void 0 ? void 0 : e.id) && !((r = t.node.bundledIn) === null || r === void 0 ? void 0 : r.id); } e.bundledTxsFilter = c; class l { constructor(t){ this.arweave = t; this.logger = o.LoggerFactory.INST.create('ArweaveGatewayInteractionsLoader'); this.arweaveWrapper = new s.ArweaveWrapper(t); this.sorter = new f.LexicographicalInteractionsSorter(t); } async load(t, e, r, o) { this.logger.debug('Loading interactions for', { contractId: t, fromSortKey: e, toSortKey: r }); const s = this.sorter.extractBlockHeight(e); const a = this.sorter.extractBlockHeight(r); const f = { tags: [ { name: n.SmartWeaveTags.APP_NAME, values: [ 'SmartWeaveAction' ] }, { name: n.SmartWeaveTags.CONTRACT_TX_ID, values: [ t ] } ], blockFilter: { min: s, max: a }, first: u }; const c = i.Benchmark.measure(); let l = await this.loadPages(f); c.stop(); if (o.internalWrites) { const h = { tags: [ { name: n.SmartWeaveTags.INTERACT_WRITE, values: [ t ] } ], blockFilter: { min: s, max: a }, first: u }; const d = await this.loadPages(h); this.logger.debug('Inner writes interactions length:', d.length); l = l.concat(d); } l = l.filter((t)=>t.node.block && t.node.block.id && t.node.block.height); let p = await this.sorter.sort(l); if (e && r) { p = p.filter((t)=>{ return t.node.sortKey.localeCompare(e) > 0 && t.node.sortKey.localeCompare(r) <= 0; }); } else if (e && !r) { p = p.filter((t)=>{ return t.node.sortKey.localeCompare(e) > 0; }); } else if (!e && r) { p = p.filter((t)=>{ return t.node.sortKey.localeCompare(r) <= 0; }); } this.logger.debug('All loaded interactions:', { from: e, to: r, loaded: p.length, time: c.elapsed() }); return p.map((t)=>t.node); } async loadPages(t) { let e = await this.getNextPage(t); const r = e.edges.filter((t)=>c(t)); while(e.pageInfo.hasNextPage){ const n = e.edges[u - 1].cursor; t = { ...t, after: n }; e = await this.getNextPage(t); r.push(...e.edges.filter((t)=>c(t))); } return r; } async getNextPage(t) { const e = i.Benchmark.measure(); let r = await this.arweaveWrapper.gql(l.query, t); this.logger.debug('GQL page load:', e.elapsed()); while(r.status === 403){ this.logger.warn(`GQL rate limiting, waiting ${l._30seconds}ms before next try.`); await (0, a.sleep)(l._30seconds); r = await this.arweaveWrapper.gql(l.query, t); } if (r.status !== 200) { throw new Error(`Unable to retrieve transactions. Arweave gateway responded with status ${r.status}.`); } if (r.data.errors) { this.logger.error(r.data.errors); throw new Error('Error while loading interaction transactions'); } const n = r.data; const o = n.data.transactions; return o; } type() { return 'arweave'; } clearCache() {} } e.ArweaveGatewayInteractionsLoader = l; l.query = `query Transactions($tags: [TagFilter!]!, $blockFilter: BlockFilter!, $first: Int!, $after: String) { transactions(tags: $tags, block: $blockFilter, first: $first, sort: HEIGHT_ASC, after: $after) { pageInfo { hasNextPage } edges { node { id owner { address } recipient tags { name value } block { height id timestamp } fee { winston } quantity { winston } parent { id } bundledIn { id } } cursor } } }`; l._30seconds = 30 * 1000; }), 7346: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.CacheableInteractionsLoader = void 0; const n = r(5913); class i { constructor(t){ this.delegate = t; this.logger = n.LoggerFactory.INST.create('CacheableInteractionsLoader'); this.interactionsCache = new Map(); } async load(t, e, r, n) { this.logger.debug(`Loading interactions for`, { contractTxId: t, fromSortKey: e, toSortKey: r }); if (!this.interactionsCache.has(t)) { const i = await this.delegate.load(t, e, r, n); if (i.length) { this.interactionsCache.set(t, i); } return i; } else { const o = this.interactionsCache.get(t); if (o === null || o === void 0 ? void 0 : o.length) { const s = o[o.length - 1].sortKey; if (s.localeCompare(r) < 0) { const a = await this.delegate.load(t, s, r, n); const f = o.concat(a); this.interactionsCache.set(t, f); return f; } } return o; } } type() { return this.delegate.type(); } clearCache() { this.interactionsCache.clear(); } } e.CacheableInteractionsLoader = i; }), 4286: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.CacheableStateEvaluator = void 0; const n = r(345); const i = r(5913); const o = r(5082); const s = r(7462); const a = r(4929); const f = r(1967); class u extends a.DefaultStateEvaluator { constructor(t, e, r = []){ super(t, r); this.cache = e; this.cLogger = i.LoggerFactory.INST.create('CacheableStateEvaluator'); } async eval(t, e) { var r, i, o, a; const u = t.cachedState; if (u && u.sortKey == t.requestedSortKey) { this.cLogger.info(`Exact cache hit for sortKey ${(r = t === null || t === void 0 ? void 0 : t.contractDefinition) === null || r === void 0 ? void 0 : r.txId}:${u.sortKey}`); (i = t.handler) === null || i === void 0 ? void 0 : i.initState(u.cachedValue.state); return u; } const c = t.sortedInteractions; const l = t.contractDefinition.txId; if (!l) { throw new Error('Contract tx id not set in the execution context'); } for (const h of e || []){ if (h.contractTxId === t.contractDefinition.txId) { const d = c.findIndex((t)=>t.id === h.interactionTxId); if (d !== -1) { this.cLogger.debug('Inf. Loop fix - removing interaction', { height: c[d].block.height, contractTxId: h.contractTxId, interactionTxId: h.interactionTxId, sortKey: c[d].sortKey }); c.splice(d); } } } if (c.length == 0) { this.cLogger.info(`No missing interactions ${l}`); if (u) { (o = t.handler) === null || o === void 0 ? void 0 : o.initState(u.cachedValue.state); return u; } else { (a = t.handler) === null || a === void 0 ? void 0 : a.initState(t.contractDefinition.initState); this.cLogger.debug('Inserting initial state into cache'); const p = new s.EvalStateResult(t.contractDefinition.initState, {}, {}); await this.cache.put(new n.CacheKey(l, f.genesisSortKey), p); return new n.SortKeyCacheResult(f.genesisSortKey, p); } } const g = u == null ? t.contractDefinition.initState : u.cachedValue.state; const b = u == null ? {} : u.cachedValue.validity; const v = u == null ? {} : u.cachedValue.errorMessages; this.cLogger.debug('Base state', g); return await this.doReadState(c, new s.EvalStateResult(g, b, v || {}), t, e); } async onStateEvaluated(t, e, r) { const n = e.contractDefinition.txId; this.cLogger.debug(`${(0, o.indent)(e.contract.callDepth())}onStateEvaluated: cache update for contract ${n} [${t.sortKey}]`); await this.putInCache(n, t, r); } async onStateUpdate(t, e, r, n = false) { if (e.evaluationOptions.updateCacheForEachInteraction || n) { this.cLogger.debug(`onStateUpdate: cache update for contract ${e.contractDefinition.txId} [${t.sortKey}]`, { contract: e.contractDefinition.txId, state: r.state, sortKey: t.sortKey }); await this.putInCache(e.contractDefinition.txId, t, r); } } async latestAvailableState(t, e) { this.cLogger.debug('Searching for', { contractTxId: t, sortKey: e }); if (e) { const r = (await this.cache.getLessOrEqual(t, e)); if (r) { this.cLogger.debug(`Latest available state at ${t}: ${r.sortKey}`); } return r; } else { return (await this.cache.getLast(t)); } } async onInternalWriteStateUpdate(t, e, r) { this.cLogger.debug('Internal write state update:', { sortKey: t.sortKey, dry: t.dry, contractTxId: e, state: r.state }); await this.putInCache(e, t, r); } async onContractCall(t, e, r) { var n; if (((n = e.sortedInteractions) === null || n === void 0 ? void 0 : n.length) == 0) { return; } const i = e.sortedInteractions.indexOf(t); if (i < 1) { return; } await this.putInCache(e.contractDefinition.txId, e.sortedInteractions[i - 1], r); } async putInCache(t, e, r) { if (e.dry) { return; } if (e.confirmationStatus !== undefined && e.confirmationStatus !== 'confirmed') { return; } const i = new s.EvalStateResult(r.state, r.validity, r.errorMessages || {}); this.cLogger.debug('Putting into cache', { contractTxId: t, transaction: e.id, sortKey: e.sortKey, dry: e.dry, state: i.state, validity: i.validity }); await this.cache.put(new n.CacheKey(t, e.sortKey), i); } async syncState(t, e, r, i) { const o = new s.EvalStateResult(r, i, {}); await this.cache.put(new n.CacheKey(t, e), o); } async dumpCache() { return await this.cache.dump(); } async internalWriteState(t, e) { return (await this.cache.get(t, e)); } async hasContractCached(t) { return (await this.cache.getLast(t)) != null; } async lastCachedSortKey() { return await this.cache.getLastSortKey(); } async allCachedContracts() { return await this.cache.allContracts(); } } e.CacheableStateEvaluator = u; }), 7089: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.ContractDefinitionLoader = void 0; const n = r(7312); const i = r(3633); const o = r(9106); const s = r(5913); const a = r(9360); const f = r(6105); const u = [ 'application/javascript', 'application/wasm' ]; class c { constructor(t, e){ this.arweave = t; this.cache = e; this.logger = s.LoggerFactory.INST.create('ContractDefinitionLoader'); this.arweaveWrapper = new a.ArweaveWrapper(t); } async load(t, e) { var r, n, i; if (!e && ((r = this.cache) === null || r === void 0 ? void 0 : r.contains(t))) { this.logger.debug('ContractDefinitionLoader: Hit from cache!'); return Promise.resolve((n = this.cache) === null || n === void 0 ? void 0 : n.get(t)); } const s = o.Benchmark.measure(); const a = await this.doLoad(t, e); this.logger.info(`Contract definition loaded in: ${s.elapsed()}`); (i = this.cache) === null || i === void 0 ? void 0 : i.put(t, a); return a; } async doLoad(t, e) { const r = o.Benchmark.measure(); const s = await this.arweaveWrapper.tx(t); const a = await this.arweave.wallets.ownerToAddress(s.owner); this.logger.debug('Contract tx and owner', r.elapsed()); r.reset(); const f = e ? e : (0, i.getTag)(s, n.SmartWeaveTags.CONTRACT_SRC_TX_ID); const u = (0, i.getTag)(s, n.SmartWeaveTags.MIN_FEE); this.logger.debug('Tags decoding', r.elapsed()); r.reset(); const c = await this.evalInitialState(s); this.logger.debug('init state', c); const l = JSON.parse(await this.evalInitialState(s)); this.logger.debug('Parsing src and init state', r.elapsed()); const { src: h , srcBinary: d , srcWasmLang: p , contractType: g , metadata: b , srcTx: v } = await this.loadContractSource(f); return { txId: t, srcTxId: f, src: h, srcBinary: d, srcWasmLang: p, initState: l, minFee: u, owner: a, contractType: g, metadata: b, contractTx: s.toJSON(), srcTx: v }; } async loadContractSource(t) { const e = o.Benchmark.measure(); const r = await this.arweaveWrapper.tx(t); const s = (0, i.getTag)(r, n.SmartWeaveTags.CONTENT_TYPE); if (!u.includes(s)) { throw new Error(`Contract source content type ${s} not supported`); } const a = s == 'application/javascript' ? 'js' : 'wasm'; const c = a == 'js' ? await this.arweaveWrapper.txDataString(t) : await this.arweaveWrapper.txData(t); let l; let h; let d; if (a == 'wasm') { h = new f.WasmSrc(c); l = (0, i.getTag)(r, n.SmartWeaveTags.WASM_LANG); if (!l) { throw new Error(`Wasm lang not set for wasm contract src ${t}`); } d = JSON.parse((0, i.getTag)(r, n.SmartWeaveTags.WASM_META)); } this.logger.debug('Contract src tx load', e.elapsed()); e.reset(); return { src: a == 'js' ? c : null, srcBinary: a == 'wasm' ? h.wasmBinary() : null, srcWasmLang: l, contractType: a, metadata: d, srcTx: r.toJSON() }; } async evalInitialState(t) { if ((0, i.getTag)(t, n.SmartWeaveTags.INIT_STATE)) { return (0, i.getTag)(t, n.SmartWeaveTags.INIT_STATE); } else if ((0, i.getTag)(t, n.SmartWeaveTags.INIT_STATE_TX)) { const e = (0, i.getTag)(t, n.SmartWeaveTags.INIT_STATE_TX); return this.arweaveWrapper.txDataString(e); } else { return this.arweaveWrapper.txDataString(t.id); } } type() { return 'arweave'; } } e.ContractDefinitionLoader = c; }), 4929: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.DefaultStateEvaluator = void 0; const i = r(8161); const o = n(r(6266)); const s = r(345); const a = r(9106); const f = r(5913); const u = r(5082); const c = r(7462); const l = r(2138); const h = r(8996); const d = new o.default.ec('secp256k1'); class p { constructor(t, e = []){ this.arweave = t; this.executionContextModifiers = e; this.logger = f.LoggerFactory.INST.create('DefaultStateEvaluator'); this.tagsParser = new h.TagsParser(); } async eval(t, e) { return this.doReadState(t.sortedInteractions, new c.EvalStateResult(t.contractDefinition.initState, {}, {}), t, e); } async doReadState(t, e, r, n) { var i; const { ignoreExceptions: o , stackTrace: f , internalWrites: h } = r.evaluationOptions; const { contract: d , contractDefinition: p , sortedInteractions: g } = r; let b = e.state; let v = null; const y = e.validity; const m = e.errorMessages; r === null || r === void 0 ? void 0 : r.handler.initState(b); const w = r.contract.callDepth(); this.logger.info(`${(0, u.indent)(w)}Evaluating state for ${p.txId} [${t.length} non-cached of ${g.length} all]`); let _ = null; let S = null; const E = t.length; r.handler.initState(b); for(let x = 0; x < E; x++){ const M = t[x]; const T = a.Benchmark.measure(); v = M.sortKey; if (M.vrf) { if (!this.verifyVrf(M.vrf, M.sortKey, this.arweave)) { throw new Error('Vrf verification failed.'); } } this.logger.debug(`${(0, u.indent)(w)}[${p.txId}][${M.id}][${M.block.height}]: ${t.indexOf(M) + 1}/${t.length} [of all:${g.length}]`); const A = this.tagsParser.isInteractWrite(M, p.txId); if (A && h) { const O = this.tagsParser.getContractTag(M); this.logger.debug(`${(0, u.indent)(w)}Internal Write - Loading writing contract`, O); const k = d.getCallStack().addInteractionData({ interaction: null, interactionTx: M, currentTx: n }); const I = r.warp.contract(O, r.contract, M); await this.onContractCall(M, r, new c.EvalStateResult(b, y, m)); this.logger.debug(`${(0, u.indent)(w)}Reading state of the calling contract at`, M.sortKey); await I.readState(M.sortKey, [ ...(n || []), { contractTxId: p.txId, interactionTxId: M.id } ]); const R = await this.internalWriteState(p.txId, M.sortKey); if (R !== null) { b = R.cachedValue.state; r === null || r === void 0 ? void 0 : r.handler.initState(b); y[M.id] = R.cachedValue.validity[M.id]; if ((i = R.cachedValue.errorMessages) === null || i === void 0 ? void 0 : i[M.id]) { m[M.id] = R.cachedValue.errorMessages[M.id]; } const N = new c.EvalStateResult(b, y, m); await this.onStateUpdate(M, r, N); if ((0, l.canBeCached)(M)) { S = { tx: M, state: N }; } } else { y[M.id] = false; } k.update({ cacheHit: false, outputState: f.saveState ? b : undefined, executionTime: T.elapsed(true), valid: y[M.id], errorMessage: _, gasUsed: 0 }); } else { const j = this.tagsParser.getInputTag(M, r.contractDefinition.txId); if (!j) { this.logger.error(`${(0, u.indent)(w)}Skipping tx - Input tag not found for ${M.id}`); continue; } const P = this.parseInput(j); if (!P) { this.logger.error(`${(0, u.indent)(w)}Skipping tx - invalid Input tag - ${M.id}`); continue; } const C = { input: P, caller: M.owner.address }; const B = { interaction: C, interactionTx: M, currentTx: n }; this.logger.debug(`${(0, u.indent)(w)}Interaction:`, C); const L = d.getCallStack().addInteractionData(B); const U = await r.handler.handle(r, new c.EvalStateResult(b, y, m), B); _ = U.errorMessage; if (U.type !== 'ok') { m[M.id] = _; } this.logResult(U, M, r); this.logger.debug(`${(0, u.indent)(w)}Interaction evaluation`, T.elapsed()); L.update({ cacheHit: false, outputState: f.saveState ? b : undefined, executionTime: T.elapsed(true), valid: y[M.id], errorMessage: _, gasUsed: U.gasUsed }); if (U.type === 'exception' && o !== true) { throw new Error(`Exception while processing ${JSON.stringify(C)}:\n${U.errorMessage}`); } y[M.id] = U.type === 'ok'; b = U.state; const D = new c.EvalStateResult(b, y, m); if ((0, l.canBeCached)(M)) { S = { tx: M, state: D }; } await this.onStateUpdate(M, r, D); } for (const { modify: $ } of this.executionContextModifiers){ r = await $(b, r); } } const F = new c.EvalStateResult(b, y, m); if (S !== null) { await this.onStateEvaluated(S.tx, r, S.state); } return new s.SortKeyCacheResult(v, F); } verifyVrf(t, e, r) { const n = d.keyFromPublic(t.pubkey, 'hex'); let o; try { o = (0, i.ProofHoHash)(n.getPublic(), r.utils.stringToBuffer(e), r.utils.b64UrlToBuffer(t.proof)); } catch (s) { return false; } return r.utils.bufferTob64Url(o) == t.index; } logResult(t, e, r) { if (t.type === 'exception') { this.logger.error(`Executing of interaction: [${r.contractDefinition.txId} -> ${e.id}] threw exception:`, `${t.errorMessage}`); } if (t.type === 'error') { this.logger.warn(`Executing of interaction: [${r.contractDefinition.txId} -> ${e.id}] returned error:`, t.errorMessage); } } parseInput(t) { try { return JSON.parse(t.value); } catch (e) { this.logger.error(e); return null; } } } e.DefaultStateEvaluator = p; }), 9174: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__setModuleDefault) || (Object.create ? (function(t, e) { Object.defineProperty(t, "default", { enumerable: true, value: e }); }) : function(t, e) { t["default"] = e; }); var o = (this && this.__importStar) || function(t) { if (t && t.__esModule) return t; var e = {}; if (t != null) for(var r in t)if (r !== "default" && Object.prototype.hasOwnProperty.call(t, r)) n(e, t, r); i(e, t); return e; }; var s = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.HandlerExecutorFactory = void 0; const a = s(r(7605)); const f = r(1692); const u = r(6505); const c = r(7170); const l = s(r(4431)); const h = o(r(7840)); const d = r(8563); const p = r(9106); const g = r(5913); const b = r(1515); const v = r(3425); const y = r(4965); const m = r(1200); class w extends Error { constructor(t){ super(t); this.name = 'ContractError'; } } class _ { constructor(t){ this.arweave = t; this.logger = g.LoggerFactory.INST.create('HandlerExecutorFactory'); this.cache = new m.MemCache(); } async create(t, e) { const r = new d.SmartWeaveGlobal(this.arweave, { id: t.txId, owner: t.owner }, e); if (t.contractType == 'wasm') { this.logger.info('Creating handler for wasm contract', t.txId); const n = p.Benchmark.measure(); let i; let o = null; const s = S(t.srcBinary); switch(t.srcWasmLang){ case 'assemblyscript': { const m = { exports: null }; i = await a.default.instantiateStreaming(s, (0, f.asWasmImports)(r, m)); m.exports = i.exports; break; } case 'rust': { const _ = { exports: null, modifiedExports: { wasm_bindgen__convert__closures__invoke2_mut__: null, _dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__: null } }; const x = await E(s, t.srcBinary); const M = WebAssembly.Module.imports(x); const T = M.filter((t)=>{ return t.module === '__wbindgen_placeholder__'; }).map((t)=>t.name); const { imports: A , exports: O } = (0, u.rustWasmImports)(r, T, _, t.metadata.dtor); o = O; i = await WebAssembly.instantiate(x, A); _.exports = i.exports; const k = Object.keys(i.exports); k.forEach((t)=>{ if (t.startsWith('wasm_bindgen__convert__closures__invoke2_mut__')) { _.modifiedExports.wasm_bindgen__convert__closures__invoke2_mut__ = i.exports[t]; } if (t.startsWith('_dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__')) { _.modifiedExports._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__ = i.exports[t]; } }); break; } case 'go': { const I = new c.Go(r); I.importObject.metering = { usegas: function(t) { r.useGas(t); } }; const R = await E(s, t.srcBinary); i = await WebAssembly.instantiate(R, I.importObject); I.run(i); o = I.exports; break; } default: { throw new Error(`Support for ${t.srcWasmLang} not implemented yet.`); } } this.logger.info(`WASM ${t.srcWasmLang} handler created in ${n.elapsed()}`); return new v.WasmHandlerApi(r, t, o || i.exports); } else { this.logger.info('Creating handler for js contract', t.txId); const N = (0, y.normalizeContractSource)(t.src, e.useVM2); if (!e.allowUnsafeClient) { if (N.includes('SmartWeave.unsafeClient')) { throw new Error('Using unsafeClient is not allowed by default. Use EvaluationOptions.allowUnsafeClient flag.'); } } if (!e.allowBigInt) { if (N.includes('BigInt')) { throw new Error('Using BigInt is not allowed by default. Use EvaluationOptions.allowBigInt flag.'); } } if (e.useVM2) { const j = new h.VMScript(N); const P = new h.NodeVM({ console: 'off', sandbox: { SmartWeave: r, BigNumber: l.default, logger: this.logger, ContractError: w, ContractAssert: function(t, e) { if (!t) throw new w(e); } }, compiler: 'javascript', eval: false, wasm: false, allowAsync: true, wrapper: 'commonjs' }); return new b.JsHandlerApi(r, t, P.run(j)); } else { const C = new Function(N); const B = C(r, l.default, g.LoggerFactory.INST.create(r.contract.id)); return new b.JsHandlerApi(r, t, B); } } } } e.HandlerExecutorFactory = _; function S(t) { const e = { status: 200, statusText: 'OK', headers: { 'Content-Type': 'application/wasm' } }; return new Response(t, e); } async function E(t, e) { if (WebAssembly.compileStreaming) { return await WebAssembly.compileStreaming(t); } else { return await WebAssembly.compile(e); } } }), 1967: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.LexicographicalInteractionsSorter = e.genesisSortKey = e.sortingLast = e.sortingFirst = void 0; const n = r(3633); const i = r(5913); const o = r(1533); const s = ''.padEnd(13, '0'); const a = ''.padEnd(13, '9'); const f = ''.padEnd(13, '0'); e.sortingFirst = ''.padEnd(64, '0'); e.sortingLast = ''.padEnd(64, 'z'); e.genesisSortKey = `${''.padStart(12, '0')},${s},${e.sortingFirst}`; class u { constructor(t){ this.arweave = t; this.logger = i.LoggerFactory.INST.create('LexicographicalInteractionsSorter'); } async sort(t) { const e = [ ...t ]; const r = e.map((t)=>this.addSortKey(t)); await Promise.all(r); return e.sort((t, e)=>t.node.sortKey.localeCompare(e.node.sortKey)); } async createSortKey(t, e, r, i = false) { const o = this.arweave.utils.b64UrlToBuffer(t); const s = this.arweave.utils.b64UrlToBuffer(e); const u = this.arweave.utils.concatBuffers([ o, s ]); const c = (0, n.arrayToHex)(await this.arweave.crypto.hash(u)); const l = `${r}`.padStart(12, '0'); const h = i ? a : f; return `${l},${h},${c}`; } extractBlockHeight(t) { return t ? parseInt(t.split(',')[0]) : null; } async addSortKey(t) { const { node: e } = t; if (t.node.sortKey !== undefined && t.node.source == o.SourceType.WARP_SEQUENCER) { this.logger.debug('Using sortKey from sequencer', t.node.sortKey); } else { t.node.sortKey = await this.createSortKey(e.block.id, e.id, e.block.height); } } generateLastSortKey(t) { const r = `${t}`.padStart(12, '0'); return `${r},${a},${e.sortingLast}`; } } e.LexicographicalInteractionsSorter = u; }), 2138: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.canBeCached = void 0; function r(t) { if (t.confirmationStatus === undefined) { return true; } else { return t.confirmationStatus === 'confirmed'; } } e.canBeCached = r; }), 8996: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.TagsParser = void 0; const n = r(7312); const i = r(5913); class o { constructor(){ this.logger = i.LoggerFactory.INST.create('TagsParser'); } getInputTag(t, e) { if (o.hasMultipleInteractions(t)) { this.logger.debug('Interaction transaction is using multiple input tx tag format.'); const r = t.tags.findIndex((t)=>t.name === n.SmartWeaveTags.CONTRACT_TX_ID && t.value === e); if (t.tags.length - 1 === r) { this.logger.warn("Wrong tags format: 'Contract' is the last tag"); return undefined; } const i = t.tags[r + 1]; if (i.name !== n.SmartWeaveTags.INPUT) { this.logger.warn(`No 'Input' tag found after 'Contract' tag. Instead ${i.name} was found`); return undefined; } return i; } else { return t.tags.find((t)=>t.name === n.SmartWeaveTags.INPUT); } } isInteractWrite(t, e) { return t.tags.some((t)=>t.name === n.SmartWeaveTags.INTERACT_WRITE && t.value === e); } getInteractWritesContracts(t) { return t.tags.filter((t)=>t.name === n.SmartWeaveTags.INTERACT_WRITE).map((t)=>t.value); } getContractTag(t) { var e; return (e = t.tags.find((t)=>t.name === n.SmartWeaveTags.CONTRACT_TX_ID)) === null || e === void 0 ? void 0 : e.value; } getContractsWithInputs(t) { const e = new Map(); const r = t.tags.filter((t)=>t.name === n.SmartWeaveTags.CONTRACT_TX_ID); r.forEach((r)=>{ e.set(r.value, this.getInputTag(t, r.value)); }); return e; } static hasMultipleInteractions(t) { return t.tags.filter((t)=>t.name === n.SmartWeaveTags.CONTRACT_TX_ID).length > 1; } } e.TagsParser = o; }), 3187: (function(t, e, r) { "use strict"; var n = r(8764)["Buffer"]; var i = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.WarpGatewayContractDefinitionLoader = void 0; const o = r(7089); r(9180); const s = r(6105); const a = i(r(7241)); const f = r(7312); const u = r(3633); const c = r(9106); const l = r(5913); const h = r(9360); const d = r(5082); class p { constructor(t, e, r){ this.baseUrl = t; this.cache = r; this.rLogger = l.LoggerFactory.INST.create('WarpGatewayContractDefinitionLoader'); this.baseUrl = (0, d.stripTrailingSlash)(t); this.contractDefinitionLoader = new o.ContractDefinitionLoader(e, r); this.arweaveWrapper = new h.ArweaveWrapper(e); } async load(t, e) { var r, n, i; if (!e && ((r = this.cache) === null || r === void 0 ? void 0 : r.contains(t))) { this.rLogger.debug('WarpGatewayContractDefinitionLoader: Hit from cache!'); return Promise.resolve((n = this.cache) === null || n === void 0 ? void 0 : n.get(t)); } const o = c.Benchmark.measure(); const s = await this.doLoad(t, e); this.rLogger.info(`Contract definition loaded in: ${o.elapsed()}`); (i = this.cache) === null || i === void 0 ? void 0 : i.put(t, s); return s; } async doLoad(t, e) { try { const r = await fetch(`${this.baseUrl}/gateway/contract?txId=${t}${e ? `&srcTxId=${e}` : ''}`).then((t)=>{ return t.ok ? t.json() : Promise.reject(t); }).catch((t)=>{ var e, r; if ((e = t.body) === null || e === void 0 ? void 0 : e.message) { this.rLogger.error(t.body.message); } throw new Error(`Unable to retrieve contract data. Warp gateway responded with status ${t.status}:${(r = t.body) === null || r === void 0 ? void 0 : r.message}`); }); if (r.srcBinary != null && !(r.srcBinary instanceof n)) { r.srcBinary = n.from(r.srcBinary.data); } if (r.srcBinary) { const i = new s.WasmSrc(r.srcBinary); r.srcBinary = i.wasmBinary(); let o; if (r.srcTx) { o = new a.default({ ...r.srcTx }); } else { o = await this.arweaveWrapper.tx(r.srcTxId); } const c = JSON.parse((0, u.getTag)(o, f.SmartWeaveTags.WASM_META)); r.metadata = c; } r.contractType = r.src ? 'js' : 'wasm'; return r; } catch (l) { this.rLogger.warn('Falling back to default contracts loader', l); return await this.contractDefinitionLoader.doLoad(t, e); } } async loadContractSource(t) { return await this.contractDefinitionLoader.loadContractSource(t); } type() { return 'warp'; } } e.WarpGatewayContractDefinitionLoader = p; }), 1533: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.WarpGatewayInteractionsLoader = e.SourceType = void 0; const n = r(9106); const i = r(5913); r(9180); const o = r(5082); var s; (function(t) { t["ARWEAVE"] = "arweave"; t["WARP_SEQUENCER"] = "redstone-sequencer"; })(s = e.SourceType || (e.SourceType = {})); class a { constructor(t, e = null, r = null){ this.baseUrl = t; this.confirmationStatus = e; this.source = r; this.logger = i.LoggerFactory.INST.create('WarpGatewayInteractionsLoader'); this.baseUrl = (0, o.stripTrailingSlash)(t); Object.assign(this, e); this.source = r; } async load(t, e, r, i) { this.logger.debug('Loading interactions: for ', { contractId: t, fromSortKey: e, toSortKey: r }); const o = []; let s = 0; let a = 0; let f = 0; const u = n.Benchmark.measure(); do { const c = n.Benchmark.measure(); const l = `${this.baseUrl}/gateway/v2/interactions-sort-key`; const h = await fetch(`${l}?${new URLSearchParams({ contractId: t, ...(e ? { from: e } : ''), ...(r ? { to: r } : ''), page: (++s).toString(), fromSdk: 'true', ...(this.confirmationStatus && this.confirmationStatus.confirmed ? { confirmationStatus: 'confirmed' } : ''), ...(this.confirmationStatus && this.confirmationStatus.notCorrupted ? { confirmationStatus: 'not_corrupted' } : ''), ...(this.source ? { source: this.source } : '') })}`).then((t)=>{ return t.ok ? t.json() : Promise.reject(t); }).catch((t)=>{ var e; if ((e = t.body) === null || e === void 0 ? void 0 : e.message) { this.logger.error(t.body.message); } throw new Error(`Unable to retrieve transactions. Warp gateway responded with status ${t.status}.`); }); this.logger.debug(`Loading interactions: page ${s} loaded in ${c.elapsed()}`); o.push(...h.interactions); a = h.paging.limit; f = h.paging.items; this.logger.debug(`Loaded interactions length: ${o.length}, from: ${e}, to: ${r}`); }while (f == a) this.logger.debug('All loaded interactions:', { from: e, to: r, loaded: o.length, time: u.elapsed() }); return o; } type() { return 'warp'; } clearCache() {} } e.WarpGatewayInteractionsLoader = a; }), 3233: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.AbstractContractHandler = void 0; const n = r(5913); const i = r(5082); class o { constructor(t, e){ this.swGlobal = t; this.contractDefinition = e; this.logger = n.LoggerFactory.INST.create('ContractHandler'); this.assignReadContractState = this.assignReadContractState.bind(this); this.assignViewContractState = this.assignViewContractState.bind(this); this.assignWrite = this.assignWrite.bind(this); this.assignRefreshState = this.assignRefreshState.bind(this); } async dispose() {} assignWrite(t, e) { this.swGlobal.contracts.write = async (r, n)=>{ if (!t.evaluationOptions.internalWrites) { throw new Error("Internal writes feature switched off. Change EvaluationOptions.internalWrites flag to 'true'"); } this.logger.debug('swGlobal.write call:', { from: this.contractDefinition.txId, to: r, input: n }); const i = t.warp.contract(r, t.contract, this.swGlobal._activeTx); const o = await i.dryWriteFromTx(n, this.swGlobal._activeTx, [ ...(e || []), { contractTxId: this.contractDefinition.txId, interactionTxId: this.swGlobal.transaction.id } ]); this.logger.debug('Cache result?:', !this.swGlobal._activeTx.dry); await t.warp.stateEvaluator.onInternalWriteStateUpdate(this.swGlobal._activeTx, r, { state: o.state, validity: { ...o.originalValidity, [this.swGlobal._activeTx.id]: o.type == 'ok' }, errorMessages: { ...o.originalErrorMessages, [this.swGlobal._activeTx.id]: o.errorMessage } }); return o; }; } assignViewContractState(t) { this.swGlobal.contracts.viewContractState = async (e, r)=>{ this.logger.debug('swGlobal.viewContractState call:', { from: this.contractDefinition.txId, to: e, input: r }); const n = t.warp.contract(e, t.contract, this.swGlobal._activeTx); return await n.viewStateForTx(r, this.swGlobal._activeTx); }; } assignReadContractState(t, e, r, n) { this.swGlobal.contracts.readContractState = async (o, s)=>{ this.logger.debug('swGlobal.readContractState call:', { from: this.contractDefinition.txId, to: o, sortKey: n.sortKey, transaction: this.swGlobal.transaction.id }); const { stateEvaluator: a } = t.warp; const f = t.warp.contract(o, t.contract, n); await a.onContractCall(n, t, r); const u = await f.readState(n.sortKey, [ ...(e || []), { contractTxId: this.contractDefinition.txId, interactionTxId: this.swGlobal.transaction.id } ]); return s ? (0, i.deepCopy)(u) : (0, i.deepCopy)(u.cachedValue.state); }; } assignRefreshState(t) { this.swGlobal.contracts.refreshState = async ()=>{ const e = t.warp.stateEvaluator; const r = await e.latestAvailableState(this.swGlobal.contract.id, this.swGlobal._activeTx.sortKey); return r === null || r === void 0 ? void 0 : r.cachedValue.state; }; } } e.AbstractContractHandler = o; }), 1515: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.JsHandlerApi = void 0; const n = r(5082); const i = r(3233); class o extends i.AbstractContractHandler { constructor(t, e, r){ super(t, e); this.contractFunction = r; } async handle(t, e, r) { const { timeoutId: i , timeoutPromise: o } = (0, n.timeout)(t.evaluationOptions.maxInteractionEvaluationTimeSeconds); try { const { interaction: s , interactionTx: a , currentTx: f } = r; const u = (0, n.deepCopy)(e.state, t.evaluationOptions.useFastCopy); this.swGlobal._activeTx = a; this.swGlobal.caller = s.caller; this.assignReadContractState(t, f, e, a); this.assignViewContractState(t); this.assignWrite(t, f); this.assignRefreshState(t); const c = await Promise.race([ o, this.contractFunction(u, s) ]); if (c && (c.state !== undefined || c.result !== undefined)) { return { type: 'ok', result: c.result, state: c.state || e.state }; } throw new Error(`Unexpected result from contract: ${JSON.stringify(c)}`); } catch (l) { switch(l.name){ case 'ContractError': return { type: 'error', errorMessage: l.message, state: e.state, result: null }; default: return { type: 'exception', errorMessage: `${(l && l.stack) || (l && l.message) || l}`, state: e.state, result: null }; } } finally{ if (i !== null) { clearTimeout(i); } } } initState(t) {} } e.JsHandlerApi = o; }), 3425: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.WasmHandlerApi = void 0; const i = n(r(7668)); const o = r(3233); class s extends o.AbstractContractHandler { constructor(t, e, r){ super(t, e); this.wasmExports = r; } async handle(t, e, r) { try { const { interaction: n , interactionTx: i , currentTx: o } = r; this.swGlobal._activeTx = i; this.swGlobal.caller = n.caller; this.swGlobal.gasLimit = t.evaluationOptions.gasLimit; this.swGlobal.gasUsed = 0; this.assignReadContractState(t, o, e, i); this.assignWrite(t, o); const s = await this.doHandle(n); return { type: 'ok', result: s, state: this.doGetCurrentState(), gasUsed: this.swGlobal.gasUsed }; } catch (f) { const a = { errorMessage: f.message, state: e.state, result: null }; if (f.message.startsWith('[RE:')) { this.logger.fatal(f); return { ...a, type: 'exception' }; } else { return { ...a, type: 'error' }; } } } initState(t) { switch(this.contractDefinition.srcWasmLang){ case 'assemblyscript': { const e = this.wasmExports.__newString((0, i.default)(t)); this.wasmExports.initState(e); break; } case 'rust': { this.wasmExports.initState(t); break; } case 'go': { this.wasmExports.initState((0, i.default)(t)); break; } default: { throw new Error(`Support for ${this.contractDefinition.srcWasmLang} not implemented yet.`); } } } async doHandle(t) { switch(this.contractDefinition.srcWasmLang){ case 'assemblyscript': { const e = this.wasmExports.__newString((0, i.default)(t.input)); const r = this.wasmExports.handle(e); const n = this.wasmExports.__getString(r); return JSON.parse(n); } case 'rust': { let o = await this.wasmExports.handle(t.input); if (!o) { return; } if (Object.prototype.hasOwnProperty.call(o, 'Ok')) { return o.Ok; } else { this.logger.debug('Error from rust', o.Err); let s; let a = ''; if (typeof o.Err === 'string' || o.Err instanceof String) { s = o.Err; } else { s = Object.keys(o.Err)[0]; a = ' ' + o.Err[s]; } if (s == 'RuntimeError') { throw new Error(`[RE:RE]${a}`); } else { throw new Error(`[CE:${s}${a}]`); } } } case 'go': { const f = await this.wasmExports.handle((0, i.default)(t.input)); return JSON.parse(f); } default: { throw new Error(`Support for ${this.contractDefinition.srcWasmLang} not implemented yet.`); } } } doGetCurrentState() { switch(this.contractDefinition.srcWasmLang){ case 'assemblyscript': { const t = this.wasmExports.currentState(); return JSON.parse(this.wasmExports.__getString(t)); } case 'rust': { return this.wasmExports.currentState(); } case 'go': { const e = this.wasmExports.currentState(); return JSON.parse(e); } default: { throw new Error(`Support for ${this.contractDefinition.srcWasmLang} not implemented yet.`); } } } } e.WasmHandlerApi = s; }), 4965: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.normalizeContractSource = void 0; function r(t, e) { const r = t.trim().split('\n'); const n = r[0]; const i = r[r.length - 1]; if ((/\(\s*\(\)\s*=>\s*{/g.test(n) || /\s*\(\s*function\s*\(\)\s*{/g.test(n)) && /}\s*\)\s*\(\)\s*;/g.test(i)) { r.shift(); r.pop(); t = r.join('\n'); } t = t.replace(/export\s+async\s+function\s+handle/gmu, 'async function handle').replace(/export\s+function\s+handle/gmu, 'function handle'); if (e) { return ` ${t} module.exports = handle;`; } else { return ` const [SmartWeave, BigNumber, logger] = arguments; class ContractError extends Error { constructor(message) { super(message); this.name = 'ContractError' } }; function ContractAssert(cond, message) { if (!cond) throw new ContractError(message) }; ${t}; return handle; `; } } e.normalizeContractSource = r; }), 6105: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.WasmSrc = void 0; const n = r(3931); const i = r(9180); const o = r(5913); class s { constructor(t){ this.src = t; this.logger = o.LoggerFactory.INST.create('WasmSrc'); this.splitted = this.splitBuffer(t); this.logger.debug(`Buffer splitted into ${this.splitted.length} parts`); } wasmBinary() { return this.splitted[0]; } async sourceCode() { const { entries: t } = await (0, n.unzip)(this.splitted[1]); const e = new Map(); for (const [r, i] of Object.entries(t)){ if (i.isDirectory) { continue; } const o = await i.text(); e.set(r, o); } return e; } additionalCode() { if (this.splitted.length == 2) { return null; } return this.splitted[2].toString(); } splitBuffer(t) { let e = ''; const r = parseInt(t.toString('utf8', 0, 1)); this.logger.debug(`Number of elements: ${r}`); const n = t.length; let o = 0; let s = 0; for(let a = 2; a < n; a++){ const f = t.toString('utf8', a, a + 1); if (f == '|') { o++; } if (o == r) { s = a + 1; break; } e += f; } this.logger.debug(`Parsed:`, { header: e, dataStart: s }); const u = e.split('|').map((t)=>parseInt(t)); this.logger.debug('Lengths', u); const c = []; for (const l of u){ const h = i.Buffer.alloc(l); const d = s + l; t.copy(h, 0, s, d); s = d; c.push(h); } return c; } } e.WasmSrc = s; }), 1692: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.asWasmImports = void 0; const n = r(5913); const i = (t, e)=>{ const r = n.LoggerFactory.INST.create('WASM:AS'); return { metering: { usegas: t.useGas }, console: { 'console.log': function(n) { r.debug(`${t.contract.id}: ${e.exports.__getString(n)}`); }, 'console.logO': function(n, i) { r.debug(`${t.contract.id}: ${e.exports.__getString(n)}`, JSON.parse(e.exports.__getString(i))); } }, block: { 'Block.height': function() { return t.block.height; }, 'Block.indep_hash': function() { return e.exports.__newString(t.block.indep_hash); }, 'Block.timestamp': function() { return t.block.timestamp; } }, transaction: { 'Transaction.id': function() { return e.exports.__newString(t.transaction.id); }, 'Transaction.owner': function() { return e.exports.__newString(t.transaction.owner); }, 'Transaction.target': function() { return e.exports.__newString(t.transaction.target); } }, contract: { 'Contract.id': function() { return e.exports.__newString(t.contract.id); }, 'Contract.owner': function() { return e.exports.__newString(t.contract.owner); } }, api: { _readContractState: (t, r)=>{ const n = e.exports.__getString(r); const o = i(t); console.log('Simulating read state of', n); return setTimeout(()=>{ console.log('calling callback'); o(e.exports.__newString(JSON.stringify({ contractTxId: n }))); }, 1000); }, clearTimeout }, env: { abort (t, n, i, o) { const s = e.exports.__getString(t); r.error('--------------------- Error message from AssemblyScript ----------------------\n'); r.error(' ' + s); r.error(' In file "' + e.exports.__getString(n) + '"'); r.error(` on line ${i}, column ${o}.`); r.error('------------------------------------------------------------------------------\n'); throw new Error(s); } } }; function i(t) { return e.exports.table.get(t); } }; e.asWasmImports = i; }), 7170: (function(t, e, r) { "use strict"; var n = r(3957); Object.defineProperty(e, "__esModule", ({ value: true })); e.Go = void 0; const i = r(5913); const o = new TextEncoder(); const s = new TextDecoder('utf-8'); let a = []; let f; (function(t) { f = t; f.redstone = { go: {} }; }.call(this, typeof r.g !== 'undefined' ? r.g : typeof self !== 'undefined' ? self : typeof window !== 'undefined' ? window : {})); class u { constructor(t){ this._callbackTimeouts = new Map(); this._nextCallbackTimeoutID = 1; const e = i.LoggerFactory.INST.create('WASM:Go'); let u = this; f.redstone.go = { WasmModule: { registerWasmModule: function(r) { u._id = r; u.exports = f[r]; delete f[r]; f.redstone.go[r] = {}; f.redstone.go[r].imports = { console: { log: function(...t) { e.debug(t[0], ...t.slice(1)); } }, Transaction: { id: function() { return t.transaction.id; }, owner: function() { return t.transaction.owner; }, target: function() { return t.transaction.target; } }, Block: { indep_hash: function() { return t.block.indep_hash; }, height: function() { return t.block.height; }, timestamp: function() { return t.block.timestamp; } }, Contract: { id: function() { return t.contract.id; }, owner: function() { return t.contract.owner; } }, SmartWeave: { readContractState: async function(e) { return await t.contracts.readContractState(e); } } }; } } }; const c = ()=>{ return new DataView(this._inst.exports.memory.buffer); }; const l = (t, e)=>{ c().setUint32(t + 0, e, true); c().setUint32(t + 4, Math.floor(e / 4294967296), true); }; const h = (t)=>{ const e = c().getUint32(t + 0, true); const r = c().getInt32(t + 4, true); return e + r * 4294967296; }; const d = (t)=>{ const e = c().getFloat64(t, true); if (e === 0) { return undefined; } if (!isNaN(e)) { return e; } const r = c().getUint32(t, true); return this._values[r]; }; const p = (t, e)=>{ const r = 0x7ff80000; if (typeof e === 'number') { if (isNaN(e)) { c().setUint32(t + 4, r, true); c().setUint32(t, 0, true); return; } if (e === 0) { c().setUint32(t + 4, r, true); c().setUint32(t, 1, true); return; } c().setFloat64(t, e, true); return; } switch(e){ case undefined: c().setFloat64(t, 0, true); return; case null: c().setUint32(t + 4, r, true); c().setUint32(t, 2, true); return; case true: c().setUint32(t + 4, r, true); c().setUint32(t, 3, true); return; case false: c().setUint32(t + 4, r, true); c().setUint32(t, 4, true); return; } let n = this._ids.get(e); if (n === undefined) { n = this._idPool.pop(); if (n === undefined) { n = this._values.length; } this._values[n] = e; this._goRefCounts[n] = 0; this._ids.set(e, n); } this._goRefCounts[n]++; let i = 1; switch(typeof e){ case 'string': i = 2; break; case 'symbol': i = 3; break; case 'function': i = 4; break; } c().setUint32(t + 4, r | i, true); c().setUint32(t, n, true); }; const g = (t, e, r = null)=>{ return new Uint8Array(this._inst.exports.memory.buffer, t, e); }; const b = (t, e, r)=>{ const n = new Array(e); for(let i = 0; i < e; i++){ n[i] = d(t + i * 8); } return n; }; const v = (t, e)=>{ return s.decode(new DataView(this._inst.exports.memory.buffer, t, e)); }; const y = Date.now() - performance.now(); this.importObject = { wasi_snapshot_preview1: { fd_write: function(t, e, r, n) { let i = 0; if (t == 1) { for(let o = 0; o < r; o++){ let f = e + o * 8; let u = c().getUint32(f + 0, true); let l = c().getUint32(f + 4, true); i += l; for(let h = 0; h < l; h++){ let d = c().getUint8(u + h); if (d == 13) {} else if (d == 10) { let p = s.decode(new Uint8Array(a)); a = []; console.log(p); } else { a.push(d); } } } } else { console.error('invalid file descriptor:', t); } c().setUint32(n, i, true); return 0; }, fd_close: ()=>0, fd_fdstat_get: ()=>0, fd_seek: ()=>0, proc_exit: (t)=>{ if (r.g.process) { n.exit(t); } else { throw 'trying to exit with code ' + t; } }, random_get: (t, e)=>{ crypto.getRandomValues(g(t, e, null)); return 0; } }, env: { 'runtime.ticks': ()=>{ return y + performance.now(); }, 'runtime.sleepTicks': (t)=>{ setTimeout(this._inst.exports.go_scheduler, t); }, 'syscall/js.finalizeRef': (t)=>{ const e = c().getUint32(t, true); this._goRefCounts[e]--; if (this._goRefCounts[e] === 0) { const r = this._values[e]; this._values[e] = null; this._ids.delete(r); this._idPool.push(e); } }, 'syscall/js.stringVal': (t, e, r)=>{ const n = v(e, r); p(t, n); }, 'syscall/js.valueGet': (t, e, r, n)=>{ let i = v(r, n); let o = d(e); let s = Reflect.get(o, i); p(t, s); }, 'syscall/js.valueSet': (t, e, r, n)=>{ const i = d(t); const o = v(e, r); const s = d(n); Reflect.set(i, o, s); }, 'syscall/js.valueDelete': (t, e, r)=>{ const n = d(t); const i = v(e, r); Reflect.deleteProperty(n, i); }, 'syscall/js.valueIndex': (t, e, r)=>{ p(t, Reflect.get(d(e), r)); }, 'syscall/js.valueSetIndex': (t, e, r)=>{ Reflect.set(d(t), e, d(r)); }, 'syscall/js.valueCall': (t, e, r, n, i, o, s)=>{ const a = d(e); const f = v(r, n); const u = b(i, o, s); try { const l = Reflect.get(a, f); p(t, Reflect.apply(l, a, u)); c().setUint8(t + 8, 1); } catch (h) { p(t, h); c().setUint8(t + 8, 0); } }, 'syscall/js.valueInvoke': (t, e, r, n, i)=>{ try { const o = d(e); const s = b(r, n, i); p(t, Reflect.apply(o, undefined, s)); c().setUint8(t + 8, 1); } catch (a) { p(t, a); c().setUint8(t + 8, 0); } }, 'syscall/js.valueNew': (t, e, r, n, i)=>{ const o = d(e); const s = b(r, n, i); try { p(t, Reflect.construct(o, s)); c().setUint8(t + 8, 1); } catch (a) { p(t, a); c().setUint8(t + 8, 0); } }, 'syscall/js.valueLength': (t)=>{ return d(t).length; }, 'syscall/js.valuePrepareString': (t, e)=>{ const r = String(d(e)); const n = o.encode(r); p(t, n); l(t + 8, n.length); }, 'syscall/js.valueLoadString': (t, e, r, n)=>{ const i = d(t); g(e, r, n).set(i); }, 'syscall/js.valueInstanceOf': (t, e)=>{ return d(t) instanceof d(e); }, 'syscall/js.copyBytesToGo': (t, e, r, n, i)=>{ let o = t; let s = t + 4; const a = g(e, r); const f = d(i); if (!(f instanceof Uint8Array)) { c().setUint8(s, 0); return; } const u = f.subarray(0, a.length); a.set(u); l(o, u.length); c().setUint8(s, 1); }, 'syscall/js.copyBytesToJS': (t, e, r, n, i)=>{ let o = t; let s = t + 4; const a = d(e); const f = g(r, n); if (!(a instanceof Uint8Array)) { c().setUint8(s, 0); return; } const u = f.subarray(0, a.length); a.set(u); l(o, u.length); c().setUint8(s, 1); } } }; } async run(t) { this._inst = t; this._values = [ NaN, 0, null, true, false, r.g, this ]; this._goRefCounts = []; this._ids = new Map(); this._idPool = []; this.exited = false; const e = new DataView(this._inst.exports.memory.buffer); while(true){ const n = new Promise((t)=>{ this._resolveCallbackPromise = ()=>{ if (this.exited) { throw new Error('bad callback: Go program has already exited'); } setTimeout(t, 0); }; }); this._inst.exports._start(); if (this.exited) { break; } await n; } } _resume() { if (this.exited) { throw new Error('Go program has already exited'); } this._inst.exports.resume(); if (this.exited) { this._resolveExitPromise(); } } _makeFuncWrapper(t) { const e = this; return function() { const r = { id: t, this: this, args: arguments }; e._pendingEvent = r; e._resume(); return r.result; }; } _resolveExitPromise() {} } e.Go = u; }), 6505: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.rustWasmImports = void 0; const n = r(5913); const i = (t, e, r, i)=>{ const o = n.LoggerFactory.INST.create('WASM:Rust'); const s = { metering: { usegas: t.useGas }, console: { log: function(e) { o.debug(`${t.contract.id}: ${e}`); } }, Block: { height: function() { return t.block.height; }, indep_hash: function() { return t.block.indep_hash; }, timestamp: function() { return t.block.timestamp; } }, Transaction: { id: function() { return t.transaction.id; }, owner: function() { return t.transaction.owner; }, target: function() { return t.transaction.target; } }, Contract: { id: function() { return t.contract.id; }, owner: function() { return t.contract.owner; } }, SmartWeave: { caller: function() { return t.caller; }, readContractState: async function(e) { return await t.contracts.readContractState(e); }, write: async function(e, r) { return await t.contracts.write(e, r); } }, Vrf: { value: function() { return t.vrf.value; }, randomInt: function(e) { return t.vrf.randomInt(e); } } }; const a = { __wbg_log_: function(t, e) { s.console.log(p(t, e)); }, __wbindgen_json_parse: function(t, e) { var r = JSON.parse(p(t, e)); return v(r); }, __wbindgen_json_serialize: function(t, e) { const n = y(e); var i = JSON.stringify(n === undefined ? null : n); var o = S(i, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var s = m; x()[t / 4 + 1] = s; x()[t / 4 + 0] = o; }, __wbindgen_object_drop_ref: function(t) { T(t); }, __wbindgen_cb_drop: function(t) { const e = T(t).original; if (e.cnt-- == 1) { e.a = 0; return true; } var r = false; return r; }, __wbg_readContractState: function(t, e) { var r = s.SmartWeave.readContractState(p(t, e)); return v(r); }, __wbg_viewContractState: function(t, e) {}, __wbg_caller: function(t) { var e = s.SmartWeave.caller(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_write: function(t, e, r) { var n = s.SmartWeave.write(p(t, e), T(r)); return v(n); }, __wbg_refreshState: function(t, e) {}, __wbg_indephash: function(t) { var e = s.Block.indep_hash(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_height: function() { var t = s.Block.height(); return t; }, __wbg_timestamp: function() { var t = s.Block.timestamp(); return t; }, __wbg_id: function(t) { var e = s.Transaction.id(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_contractOwner: function(t) { var e = s.Contract.owner(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_contractId: function(t) { var e = s.Contract.id(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_owner: function(t) { var e = s.Transaction.owner(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_target: function(t) { var e = s.Transaction.target(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_call: function() { return N(function(t, e, r) { var n = y(t).call(y(e), y(r)); return v(n); }, arguments); }, __wbg_new: function(t, e) { try { var r = { a: t, b: e }; var n = (t, e)=>{ const n = r.a; r.a = 0; try { return j(n, r.b, t, e); } finally{ r.a = n; } }; var i = new Promise(n); return v(i); } finally{ r.a = r.b = 0; } }, __wbg_resolve: function(t) { var e = Promise.resolve(y(t)); return v(e); }, __wbg_then_a: function(t, e) { var r = y(t).then(y(e)); return v(r); }, __wbg_then_5: function(t, e, r) { var n = y(t).then(y(e), y(r)); return v(n); }, __wbindgen_debug_string: function(t, e) { var n = A(y(e)); var i = S(n, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var o = m; x()[t / 4 + 1] = o; x()[t / 4 + 0] = i; }, __wbindgen_throw: function(t, e) { throw new Error(p(t, e)); }, __wbindgen_closure_wrapper: function(t, e, r) { var n = O(t, e, i, k); return v(n); }, __wbindgen_string_new: function(t, e) { var r = p(t, e); return v(r); }, __wbg_value: function(t) { var e = s.Vrf.value(); var n = S(e, r.exports.__wbindgen_malloc, r.exports.__wbindgen_realloc); var i = m; x()[t / 4 + 1] = i; x()[t / 4 + 0] = n; }, __wbg_randomInt: function(t, e) { var r = s.Vrf.randomInt(e); return r; } }; const f = Object.keys(a); let u = e.reduce((t, e)=>{ const r = f.find((t)=>e.startsWith(t)); if (r === undefined) { throw new Error(`Cannot find import mapping for ${e}`); } t[e] = a[r]; return t; }, {}); let c = {}; c['__wbindgen_placeholder__'] = u; let l = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }); l.decode(); let h = null; function d() { if (h === null || h.buffer !== r.exports.memory.buffer) { h = new Uint8Array(r.exports.memory.buffer); } return h; } function p(t, e) { return l.decode(d().subarray(t, t + e)); } const g = new Array(32).fill(undefined); g.push(undefined, null, true, false); let b = g.length; function v(t) { if (b === g.length) g.push(g.length + 1); const e = b; b = g[e]; g[e] = t; return e; } function y(t) { return g[t]; } let m = 0; let w = new TextEncoder('utf-8'); const _ = typeof w.encodeInto === 'function' ? function(t, e) { return w.encodeInto(t, e); } : function(t, e) { const r = w.encode(t); e.set(r); return { read: t.length, written: r.length }; }; function S(t, e, r) { if (r === undefined) { const n = w.encode(t); const i = e(n.length); d().subarray(i, i + n.length).set(n); m = n.length; return i; } let o = t.length; let s = e(o); const a = d(); let f = 0; for(; f < o; f++){ const u = t.charCodeAt(f); if (u > 0x7f) break; a[s + f] = u; } if (f !== o) { if (f !== 0) { t = t.slice(f); } s = r(s, o, (o = f + t.length * 3)); const c = d().subarray(s + f, s + o); const l = _(t, c); f += l.written; } m = f; return s; } let E = null; function x() { if (E === null || E.buffer !== r.exports.memory.buffer) { E = new Int32Array(r.exports.memory.buffer); } return E; } function M(t) { if (t < 36) return; g[t] = b; b = t; } function T(t) { const e = y(t); M(t); return e; } function A(t) { const e = typeof t; if (e == 'number' || e == 'boolean' || t == null) { return `${t}`; } if (e == 'string') { return `"${t}"`; } if (e == 'symbol') { const r = t.description; if (r == null) { return 'Symbol'; } else { return `Symbol(${r})`; } } if (e == 'function') { const n = t.name; if (typeof n == 'string' && n.length > 0) { return `Function(${n})`; } else { return 'Function'; } } if (Array.isArray(t)) { const i = t.length; let o = '['; if (i > 0) { o += A(t[0]); } for(let s = 1; s < i; s++){ o += ', ' + A(t[s]); } o += ']'; return o; } const a = /\[object ([^\]]+)\]/.exec(toString.call(t)); let f; if (a.length > 1) { f = a[1]; } else { return toString.call(t); } if (f == 'Object') { try { return 'Object(' + JSON.stringify(t) + ')'; } catch (u) { return 'Object'; } } if (t instanceof Error) { return `${t.name}: ${t.message}\n${t.stack}`; } return f; } function O(t, e, n, i) { const o = { a: t, b: e, cnt: 1, dtor: n }; const s = (...t)=>{ o.cnt++; const e = o.a; o.a = 0; try { return i(e, o.b, ...t); } finally{ if (--o.cnt === 0) { r.exports.__wbindgen_export_2.get(o.dtor)(e, o.b); } else { o.a = e; } } }; s.original = o; return s; } function k(t, e, n) { r.modifiedExports._dyn_core__ops__function__FnMut__A____Output___R_as_wasm_bindgen__closure__WasmClosure___describe__invoke__(t, e, v(n)); } u.handle = function(t) { var e = r.exports.handle(v(t)); return T(e); }; let I = 32; function R(t) { if (I == 1) throw new Error('out of js stack'); g[--I] = t; return I; } u.initState = function(t) { try { r.exports.initState(R(t)); } finally{ g[I++] = undefined; } }; u.currentState = function() { var t = r.exports.currentState(); return T(t); }; u.lang = function() { try { const t = r.exports.__wbindgen_add_to_stack_pointer(-16); r.exports.lang(t); var e = x()[t / 4 + 0]; var n = x()[t / 4 + 1]; return p(e, n); } finally{ r.exports.__wbindgen_add_to_stack_pointer(16); r.exports.__wbindgen_free(e, n); } }; u.type = function() { var t = r.exports.type(); return t; }; function N(t, e) { try { return t.apply(this, e); } catch (n) { r.exports.__wbindgen_exn_store(v(n)); } } function j(t, e, n, i) { r.modifiedExports.wasm_bindgen__convert__closures__invoke2_mut__(t, e, v(n), v(i)); } class P { __destroy_into_raw() { const t = this.ptr; this.ptr = 0; return t; } free() { const t = this.__destroy_into_raw(); r.exports.__wbg_statewrapper_free(t); } } u.StateWrapper = P; c.metering = s.metering; return { imports: c, exports: u }; }; e.rustWasmImports = i; }), 4742: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.matchMutClosureDtor = void 0; function r(t) { const e = /var ret = makeMutClosure\(arg0, arg1, (\d+?), __wbg_adapter/; const r = t.match(e); return r[1]; } e.matchMutClosureDtor = r; }), 702: (function(t, e, r) { "use strict"; var n = (this && this.__createBinding) || (Object.create ? (function(t, e, r, n) { if (n === undefined) n = r; var i = Object.getOwnPropertyDescriptor(e, r); if (!i || ("get" in i ? !e.__esModule : i.writable || i.configurable)) { i = { enumerable: true, get: function() { return e[r]; } }; } Object.defineProperty(t, n, i); }) : (function(t, e, r, n) { if (n === undefined) n = r; t[n] = e[r]; })); var i = (this && this.__exportStar) || function(t, e) { for(var r in t)if (r !== "default" && !Object.prototype.hasOwnProperty.call(e, r)) n(e, t, r); }; Object.defineProperty(e, "__esModule", ({ value: true })); i(r(183), e); i(r(4089), e); i(r(2393), e); i(r(5913), e); i(r(5629), e); i(r(9106), e); i(r(2656), e); i(r(5368), e); i(r(5765), e); i(r(6769), e); i(r(7462), e); i(r(7089), e); i(r(3187), e); i(r(9564), e); i(r(1533), e); i(r(7346), e); i(r(4929), e); i(r(4286), e); i(r(9174), e); i(r(1967), e); i(r(8996), e); i(r(4965), e); i(r(2138), e); i(r(6105), e); i(r(3233), e); i(r(1515), e); i(r(3425), e); i(r(8632), e); i(r(7312), e); i(r(4805), e); i(r(9305), e); i(r(5614), e); i(r(8479), e); i(r(2009), e); i(r(9689), e); i(r(8469), e); i(r(9692), e); i(r(7665), e); i(r(7819), e); i(r(8102), e); i(r(4722), e); i(r(4217), e); i(r(5731), e); i(r(3611), e); i(r(4708), e); i(r(8563), e); i(r(9925), e); i(r(3633), e); i(r(40), e); i(r(5082), e); i(r(9360), e); }), 40: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.unpackTags = e.createDummyTx = e.createInteractionTx = void 0; const n = r(7312); async function i(t, e, r, i, o, s = '', a = '0', f = false, u) { const c = { data: Math.random().toString().slice(-4) }; if (s && s.length) { c.target = s.toString(); if (a && +a > 0) { c.quantity = a.toString(); } } if (f) { c.reward = '72600854'; c.last_tx = 'p7vc1iSP6bvH_fCeUFa9LqoV5qiyW-jdEKouAT0XMoSwrNraB9mgpi29Q10waEpO'; } if (u && u.length) { c.reward = u; } const l = await t.createTransaction(c); if (!i) { throw new Error(`Input should be a truthy value: ${JSON.stringify(i)}`); } if (o && o.length) { for (const h of o){ l.addTag(h.name.toString(), h.value.toString()); } } l.addTag(n.SmartWeaveTags.APP_NAME, 'SmartWeaveAction'); l.addTag(n.SmartWeaveTags.APP_VERSION, '0.3.0'); l.addTag(n.SmartWeaveTags.SDK, 'Warp'); l.addTag(n.SmartWeaveTags.CONTRACT_TX_ID, r); l.addTag(n.SmartWeaveTags.INPUT, JSON.stringify(i)); if (e) { await e(l); } return l; } e.createInteractionTx = i; function o(t, e, r) { const n = s(t); return { id: t.id, owner: { address: e, key: '' }, recipient: t.target, tags: n, fee: { winston: t.reward, ar: '' }, quantity: { winston: t.quantity, ar: '' }, block: { id: r.indep_hash, height: r.height, timestamp: r.timestamp, previous: null }, dry: true, anchor: null, signature: null, data: null, parent: null, bundledIn: null }; } e.createDummyTx = o; function s(t) { const e = t.get('tags'); const r = []; for (const n of e){ try { const i = n.get('name', { decode: true, string: true }); const o = n.get('value', { decode: true, string: true }); r.push({ name: i, value: o }); } catch (s) {} } return r; } e.unpackTags = s; }), 9925: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.SmartWeaveError = e.SmartWeaveErrorType = void 0; var r; (function(t) { t["CONTRACT_NOT_FOUND"] = "CONTRACT_NOT_FOUND"; })(r = e.SmartWeaveErrorType || (e.SmartWeaveErrorType = {})); class n extends Error { constructor(t, e = {}){ if (e.message) { super(e.message); } else { super(); } this.type = t; this.otherInfo = e; } getType() { return this.type; } } e.SmartWeaveError = n; }), 4708: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 8563: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.SmartWeaveGlobal = void 0; class r { constructor(t, e, r){ this.gasUsed = 0; this.gasLimit = Number.MAX_SAFE_INTEGER; this.unsafeClient = t; this.arweave = { ar: t.ar, utils: t.utils, wallets: t.wallets, crypto: t.crypto }; this.evaluationOptions = r; this.contract = e; this.transaction = new n(this); this.block = new i(this); this.contracts = { readContractState: (t, e, r)=>{ throw new Error('Not implemented - should be set by HandlerApi implementor'); }, viewContractState: (t, e)=>{ throw new Error('Not implemented - should be set by HandlerApi implementor'); }, write: (t, e)=>{ throw new Error('Not implemented - should be set by HandlerApi implementor'); }, refreshState: ()=>{ throw new Error('Not implemented - should be set by HandlerApi implementor'); } }; this.vrf = new o(this); this.useGas = this.useGas.bind(this); this.getBalance = this.getBalance.bind(this); } useGas(t) { if (t < 0) { throw new Error(`[RE:GNE] Gas number exception - gas < 0.`); } this.gasUsed += t; if (this.gasUsed > this.gasLimit) { throw new Error(`[RE:OOG] Out of gas! Used: ${this.gasUsed}, limit: ${this.gasLimit}`); } } async getBalance(t, e) { if (!this._activeTx) { throw new Error('Cannot read balance - active tx is not set.'); } if (!this.block.height) { throw new Error('Cannot read balance - block height not set.'); } const r = e || this.block.height; return await fetch(`${this.evaluationOptions.walletBalanceUrl}block/height/${r}/wallet/${t}/balance`).then((t)=>{ return t.ok ? t.text() : Promise.reject(t); }).catch((t)=>{ var e; throw new Error(`Unable to read wallet balance. ${t.status}. ${(e = t.body) === null || e === void 0 ? void 0 : e.message}`); }); } } e.SmartWeaveGlobal = r; class n { constructor(t){ this.smartWeaveGlobal = t; } get id() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.id; } get owner() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.owner.address; } get target() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.recipient; } get tags() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.tags; } get quantity() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.quantity.winston; } get reward() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.fee.winston; } } class i { constructor(t){ this.smartWeaveGlobal = t; } get height() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.block.height; } get indep_hash() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current Tx'); } return this.smartWeaveGlobal._activeTx.block.id; } get timestamp() { if (!this.smartWeaveGlobal._activeTx) { throw new Error('No current tx'); } return this.smartWeaveGlobal._activeTx.block.timestamp; } } class o { constructor(t){ this.smartWeaveGlobal = t; } get data() { return this.smartWeaveGlobal._activeTx.vrf; } get value() { return this.smartWeaveGlobal._activeTx.vrf.bigint; } randomInt(t) { if (!Number.isInteger(t)) { throw new Error('Integer max value required for random integer generation'); } const e = (BigInt(this.smartWeaveGlobal._activeTx.vrf.bigint) % BigInt(t)) + BigInt(1); if (e > Number.MAX_SAFE_INTEGER || e < Number.MIN_SAFE_INTEGER) { throw new Error('Random int cannot be cast to number'); } return Number(e); } } }), 3633: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.arrayToHex = e.getTag = void 0; function r(t, e) { const r = t.get('tags'); for (const n of r){ try { if (n.get('name', { decode: true, string: true }) === e) { return n.get('value', { decode: true, string: true }); } } catch (i) {} } return false; } e.getTag = r; function n(t) { let e = ''; for (const r of t){ e += ('0' + r.toString(16)).slice(-2); } return e; } e.arrayToHex = n; }), 9106: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.Benchmark = void 0; class r { constructor(){ this.start = Date.now(); this.end = null; } static measure() { return new r(); } reset() { this.start = Date.now(); this.end = null; } stop() { this.end = Date.now(); } elapsed(t = false) { if (this.end === null) { this.end = Date.now(); } const e = this.end - this.start; return t ? e : `${(this.end - this.start).toFixed(0)}ms`; } } e.Benchmark = r; }), 5913: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.LoggerFactory = void 0; const n = r(4089); class i { constructor(){} setOptions(t, e) { i.INST.setOptions(t, e); } getOptions(t) { return i.INST.getOptions(t); } logLevel(t, e) { i.INST.logLevel(t, e); } create(t) { return i.INST.create(t); } static use(t) { i.INST = t; } } e.LoggerFactory = i; i.INST = new n.ConsoleLoggerFactory(); }), 5629: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.lvlToOrder = e.LogLevelOrder = void 0; e.LogLevelOrder = { silly: 0, trace: 1, debug: 2, info: 3, warn: 4, error: 5, fatal: 6 }; function r(t) { return e.LogLevelOrder[t]; } e.lvlToOrder = r; }), 2393: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); }), 183: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.ConsoleLogger = void 0; const n = r(5629); class i { constructor(t, e){ this.moduleName = t; this.settings = e; } trace(t, ...e) { if (this.shouldLog('trace')) { console.debug(this.message('trace', t), e); } } error(t, ...e) { if (this.shouldLog('error')) { console.error(this.message('error', t), e); } } info(t, ...e) { if (this.shouldLog('info')) { console.info(this.message('info', t), e); } } silly(t, ...e) { if (this.shouldLog('silly')) { console.debug(this.message('silly', t), e); } } debug(t, ...e) { if (this.shouldLog('debug')) { console.debug(this.message('debug', t), e); } } warn(t, ...e) { if (this.shouldLog('warn')) { console.warn(this.message('warn', t), e); } } log(t, ...e) { if (this.shouldLog('info')) { console.info(this.message('info', t), e); } } fatal(t, ...e) { if (this.shouldLog('fatal')) { console.error(this.message('fatal', t), e); } } shouldLog(t) { return (0, n.lvlToOrder)(t) >= (0, n.lvlToOrder)(this.settings.minLevel); } setSettings(t) { this.settings = t; } message(t, e) { return `${new Date().toISOString()} ${t.toUpperCase()} [${this.moduleName}] ${e}`; } } e.ConsoleLogger = i; }), 4089: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.ConsoleLoggerFactory = void 0; const n = r(183); class i { constructor(){ this.registeredLoggers = {}; this.registeredOptions = {}; this.defOptions = { minLevel: 'info' }; this.setOptions = this.setOptions.bind(this); this.getOptions = this.getOptions.bind(this); this.create = this.create.bind(this); this.logLevel = this.logLevel.bind(this); } setOptions(t, e) { if (!e) { this.defOptions = t; Object.keys(this.registeredLoggers).forEach((e)=>{ this.registeredLoggers[e].setSettings({ ...this.registeredLoggers[e].settings, ...t }); }); } else { if (this.registeredLoggers[e]) { this.registeredLoggers[e].setSettings({ ...this.registeredLoggers[e].settings, ...t }); } else { this.registeredOptions[e] = { ...this.defOptions, ...t }; } } } getOptions(t) { if (!t) { return this.defOptions; } else { if (this.registeredLoggers[t]) { return this.registeredLoggers[t].settings; } else if (this.registeredOptions[t]) { return this.registeredOptions[t]; } else { return this.defOptions; } } } logLevel(t, e) { this.setOptions({ minLevel: t }, e); } create(t = 'SWC') { if (!Object.prototype.hasOwnProperty.call(this.registeredLoggers, t)) { this.registeredLoggers[t] = new n.ConsoleLogger(t, this.getOptions(t)); } return this.registeredLoggers[t]; } } e.ConsoleLoggerFactory = i; }), 7794: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.CacheableExecutorFactory = void 0; const n = r(5913); class i { constructor(t, e, r){ this.arweave = t; this.baseImplementation = e; this.cache = r; this.logger = n.LoggerFactory.INST.create('CacheableExecutorFactory'); } async create(t, e) { return await this.baseImplementation.create(t, e); } } e.CacheableExecutorFactory = i; }), 4481: (function(t, e) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.DebuggableExecutorFactory = void 0; class r { constructor(t, e){ this.baseImplementation = t; this.sourceCode = e; } async create(t, e) { if (Object.prototype.hasOwnProperty.call(this.sourceCode, t.txId)) { t = { ...t, src: this.sourceCode[t.txId] }; } return await this.baseImplementation.create(t, e); } } e.DebuggableExecutorFactory = r; }), 2491: (function(t, e, r) { "use strict"; Object.defineProperty(e, "__esModule", ({ value: true })); e.Evolve = void 0; const n = r(5913); const i = r(9925); function o(t) { if (!t) { return false; } const e = a(t); return t.evolve !== undefined || e.has('evolve'); } class s { constructor(){ this.logger = n.LoggerFactory.INST.create('Evolve'); this.modify = this.modify.bind(this); } async modify(t, e) { const { definitionLoader: r , executorFactory: n } = e.warp; const o = e.contractDefinition.txId; const a = s.evolvedSrcTxId(t); const f = e.contractDefinition.srcTxId; if (a) { this.logger.debug('Checking evolve:', { current: f, evolvedSrcTxId: a }); if (f !== a) { try { this.logger.info('Evolving to: ', a); const u = await r.load(o, a); const c = (await n.create(u, e.evaluationOptions)); e.contractDefinition = u; e.handler = c; e.handler.initState(t); this.logger.debug('evolved to:', { evolve: a, newSrcTxId: e.contractDefinition.srcTxId, current: f, txId: e.contractDefinition.txId }); return e; } catch (l) { throw new i.SmartWeaveError(i.SmartWeaveErrorType.CONTRACT_NOT_FOUND, { message: `Contract having txId: ${o} not found`, requestedTxId: o }); } } } return e; } static evolvedSrcTxId(t) { if (!o(t)) { return undefined; } const e = a(t); const r = t.evolve || e.get('evolve'); let n = t.canEvolve || e.get('canEvolve'); if (n === undefined || n === null) { n = true; } if (r && /[a-z0-9_-]{43}/i.test(r) && n) { return r; } return undefined; } } e.Evolve = s; function a(t) { let e = new Map(); if (t.settings) { if (f(t.settings)) { e = new Map(t.settings); } else if (u(t.settings)) { e = new Map(Object.entries(t.settings)); } } return e; } function f(t) { if (t == null) { return false; } return typeof t[Symbol.iterator] === 'function'; } function u(t) { return typeof t === 'object' && t !== null && !Array.isArray(t); } }), 9360: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.ArweaveWrapper = void 0; const i = n(r(7386)); const o = n(r(7241)); const s = r(9180); const a = r(8479); const f = r(5913); class u { constructor(t){ this.arweave = t; this.logger = f.LoggerFactory.INST.create('ArweaveWrapper'); this.baseUrl = `${t.api.config.protocol}://${t.api.config.host}:${t.api.config.port}`; this.logger.debug('baseurl', this.baseUrl); } async warpGwInfo() { return await this.doFetchInfo(`${a.WARP_GW_URL}/gateway/arweave/info`); } async warpGwBlock() { this.logger.debug('Calling warp gw block info'); return await this.doFetchInfo(`${a.WARP_GW_URL}/gateway/arweave/block`); } async info() { return await this.doFetchInfo(`${this.baseUrl}/info`); } async gql(t, e) { try { const r = JSON.stringify({ query: t, variables: e }); const n = await fetch(`${this.baseUrl}/graphql`, { method: 'POST', body: r, headers: { 'Accept-Encoding': 'gzip, deflate, br', 'Content-Type': 'application/json', Accept: 'application/json' } }).then((t)=>{ return t.ok ? t.json() : Promise.reject(t); }).catch((t)=>{ var e, r; if ((e = t.body) === null || e === void 0 ? void 0 : e.message) { this.logger.error(t.body.message); } throw new Error(`Unable to retrieve gql page. ${t.status}: ${(r = t.body) === null || r === void 0 ? void 0 : r.message}`); }); return { data: n, status: 200 }; } catch (i) { this.logger.error('Error while loading gql', i); throw i; } } async tx(t) { const e = await fetch(`${this.baseUrl}/tx/${t}`).then((t)=>{ return t.ok ? t.json() : Promise.reject(t); }).catch((e)=>{ var r, n; if ((r = e.body) === null || r === void 0 ? void 0 : r.message) { this.logger.error(e.body.message); } throw new Error(`Unable to retrieve tx ${t}. ${e.status}. ${(n = e.body) === null || n === void 0 ? void 0 : n.message}`); }); return new o.default({ ...e }); } async txData(t) { const e = await fetch(`${this.baseUrl}/${t}`); if (!e.ok) { this.logger.warn(`Unable to load data from arweave.net/${t} endpoint, falling back to arweave.js`); const r = (await this.arweave.transactions.getData(t, { decode: true })); return s.Buffer.from(r); } else { const n = await e.arrayBuffer(); return s.Buffer.from(n); } } async txDataString(t) { const e = await this.txData(t); return i.default.utils.bufferToString(e); } async doFetchInfo(t) { try { const e = await fetch(t).then((t)=>{ return t.ok ? t.json() : Promise.reject(t); }).catch((t)=>{ var e, r; if ((e = t.body) === null || e === void 0 ? void 0 : e.message) { this.logger.error(t.body.message); } throw new Error(`Unable to retrieve info. ${t.status}: ${(r = t.body) === null || r === void 0 ? void 0 : r.message}`); }); return e; } catch (r) { this.logger.error('Error while loading info', r); throw r; } } } e.ArweaveWrapper = u; }), 5082: (function(t, e, r) { "use strict"; var n = (this && this.__importDefault) || function(t) { return (t && t.__esModule) ? t : { "default": t }; }; Object.defineProperty(e, "__esModule", ({ value: true })); e.indent = e.stripTrailingSlash = e.timeout = e.descS = e.desc = e.ascS = e.asc = e.mapReviver = e.mapReplacer = e.deepCopy = e.sleep = void 0; const i = n(r(361)); const o = n(r(3346)); const s = (t)=>{ return new Promise((e)=>setTimeout(e, t)); }; e.sleep = s; const a = (t, e = false)=>{ return e ? (0, o.default)(t) : (0, i.default)(t); }; e.deepCopy = a; const f = (t, e)=>{ if (e instanceof Map) { return { dataType: 'Map', value: Array.from(e.entries()) }; } else { return e; } }; e.mapReplacer = f; const u = (t, e)=>{ if (typeof e === 'object' && e !== null) { if (e.dataType === 'Map') { return new Map(e.value); } } return e; }; e.mapReviver = u; const c = (t, e)=>t - e; e.asc = c; const l = (t, e)=>+t - +e; e.ascS = l; const h = (t, e)=>e - t; e.desc = h; const d = (t, e)=>+e - +t; e.descS = d; function p(t) { let e = null; const r = new Promise((r, n)=>{ e = setTimeout(()=>{ clearTimeout(e); n('timeout'); }, t * 1000); }); return { timeoutId: e, timeoutPromise: r }; } e.timeout = p; function g(t) { return t.endsWith('/') ? t.slice(0, -1) : t; } e.stripTrailingSlash = g; function b(t) { return ''.padEnd(t * 2, ' '); } e.indent = b; }), 6430: (function(t, e, r) { "use strict"; var n = r(4029); var i = r(3083); var o = r(1924); var s = o('Object.prototype.toString'); var a = r(6410)(); var f = typeof globalThis === 'undefined' ? r.g : globalThis; var u = i(); var c = o('String.prototype.slice'); var l = {}; var h = r(882); var d = Object.getPrototypeOf; if (a && h && d) { n(u, function(t) { if (typeof f[t] === 'function') { var e = new f[t](); if (Symbol.toStringTag in e) { var r = d(e); var n = h(r, Symbol.toStringTag); if (!n) { var i = d(r); n = h(i, Symbol.toStringTag); } l[t] = n.get; } } }); } var p = function t(e) { var r = false; n(l, function(t, n) { if (!r) { try { var i = t.call(e); if (i === n) { r = i; } } catch (o) {} } }); return r; }; var g = r(5692); t.exports = function t(e) { if (!g(e)) { return false; } if (!a || !(Symbol.toStringTag in e)) { return c(s(e), 8, -1); } return p(e); }; }), 7605: (function(t, e) { var r, n; var i = (function(t) { "use strict"; Object.defineProperty(t, "__esModule", { value: true }); t.default = void 0; t.demangle = P; t.instantiate = R; t.instantiateStreaming = j; t.instantiateSync = N; const e = -8; const r = -4; const n = 0; const i = 1; const o = 1 << 0; const s = 1 << 1; const a = 1 << 2; const f = 6; const u = 1 << 11; const c = 1 << 12; const l = 1 << 14; const h = 0; const d = 4; const p = 8; const g = 12; const b = 12; const v = 16; const y = "Operation requires compiling with --exportTable"; const m = "Operation requires compiling with --exportRuntime"; const w = ()=>{ throw Error(m); }; const _ = typeof BigUint64Array !== "undefined"; const S = Symbol(); const E = 192; const x = 1024; const M = new TextDecoder("utf-16le", { fatal: true }); Object.hasOwn = Object.hasOwn || function(t, e) { return Object.prototype.hasOwnProperty.call(t, e); }; function T(t, e) { let n = new Uint32Array(t)[e + r >>> 2] >>> 1; const i = new Uint16Array(t, e, n); if (n <= E) return String.fromCharCode(...i); try { return M.decode(i); } catch { let o = "", s = 0; while(n - s > x){ o += String.fromCharCode(...i.subarray(s, s += x)); } return o + String.fromCharCode(...i.subarray(s)); } } function A(t) { const e = {}; function r(t, e) { if (!t) return ""; return T(t.buffer, e); } const n = t.env = t.env || {}; n.abort = n.abort || function t(i, o, s, a) { const f = e.memory || n.memory; throw Error(`abort: ${r(f, i)} at ${r(f, o)}:${s}:${a}`); }; n.trace = n.trace || function t(i, o, ...s) { const a = e.memory || n.memory; console.log(`trace: ${r(a, i)}${o ? " " : ""}${s.slice(0, o).join(", ")}`); }; n.seed = n.seed || Date.now; t.Math = t.Math || Math; t.Date = t.Date || Date; return e; } function O(t, m) { const S = m.exports; const E = S.memory; const x = S.table; const M = S.__new || w; const A = S.__pin || w; const O = S.__unpin || w; const k = S.__collect || w; const I = S.__rtti_base; const R = I ? (t)=>t[I >>> 2] : w; t.__new = M; t.__pin = A; t.__unpin = O; t.__collect = k; function N(t) { const e = new Uint32Array(E.buffer); if ((t >>>= 0) >= R(e)) throw Error(`invalid id: ${t}`); return e[(I + 4 >>> 2) + (t << 1)]; } function j(t) { const e = new Uint32Array(E.buffer); if ((t >>>= 0) >= R(e)) throw Error(`invalid id: ${t}`); return e[(I + 4 >>> 2) + (t << 1) + 1]; } function C(t) { const e = N(t); if (!(e & (o | s | a))) throw Error(`not an array: ${t}, flags=${e}`); return e; } function B(t) { return 31 - Math.clz32(t >>> f & 31); } function L(t) { if (t == null) return 0; const e = t.length; const r = M(e << 1, i); const n = new Uint16Array(E.buffer); for(var o = 0, s = r >>> 1; o < e; ++o)n[s + o] = t.charCodeAt(o); return r; } t.__newString = L; function U(t) { if (t == null) return 0; const e = new Uint8Array(t); const r = M(e.length, n); const i = new Uint8Array(E.buffer); i.set(e, r); return r; } t.__newArrayBuffer = U; function D(t) { if (!t) return null; const r = E.buffer; const n = new Uint32Array(r)[t + e >>> 2]; if (n !== i) throw Error(`not a string: ${t}`); return T(r, t); } t.__getString = D; function $(t, e, r) { const n = E.buffer; if (r) { switch(t){ case 2: return new Float32Array(n); case 3: return new Float64Array(n); } } else { switch(t){ case 0: return new (e ? Int8Array : Uint8Array)(n); case 1: return new (e ? Int16Array : Uint16Array)(n); case 2: return new (e ? Int32Array : Uint32Array)(n); case 3: return new (e ? BigInt64Array : BigUint64Array)(n); } } throw Error(`unsupported align: ${t}`); } function F(t, e = 0) { const r = e; const i = C(t); const o = B(i); const f = typeof r !== "number"; const y = f ? r.length : r; const m = M(y << o, i & a ? t : n); let w; if (i & a) { w = m; } else { A(m); const _ = M(i & s ? v : g, t); O(m); const S = new Uint32Array(E.buffer); S[_ + h >>> 2] = m; S[_ + d >>> 2] = m; S[_ + p >>> 2] = y << o; if (i & s) S[_ + b >>> 2] = y; w = _; } if (f) { const x = $(o, i & u, i & c); const T = m >>> o; if (i & l) { for(let k = 0; k < y; ++k){ x[T + k] = r[k]; } } else { x.set(r, T); } } return w; } t.__newArray = F; function W(t) { const n = new Uint32Array(E.buffer); const i = n[t + e >>> 2]; const o = C(i); const f = B(o); let l = o & a ? t : n[t + d >>> 2]; const h = o & s ? n[t + b >>> 2] : n[l + r >>> 2] >>> f; return $(f, o & u, o & c).subarray(l >>>= f, l + h); } t.__getArrayView = W; function q(t) { const e = W(t); const r = e.length; const n = new Array(r); for(let i = 0; i < r; i++)n[i] = e[i]; return n; } t.__getArray = q; function z(t) { const e = E.buffer; const n = new Uint32Array(e)[t + r >>> 2]; return e.slice(t, t + n); } t.__getArrayBuffer = z; function G(t) { if (!x) throw Error(y); const e = new Uint32Array(E.buffer)[t >>> 2]; return x.get(e); } t.__getFunction = G; function K(t, e, r) { return new t(V(t, e, r)); } function V(t, e, r) { const n = E.buffer; const i = new Uint32Array(n); return new t(n, i[r + d >>> 2], i[r + p >>> 2] >>> e); } function H(e, r, n) { t[`__get${r}`] = K.bind(null, e, n); t[`__get${r}View`] = V.bind(null, e, n); } [ Int8Array, Uint8Array, Uint8ClampedArray, Int16Array, Uint16Array, Int32Array, Uint32Array, Float32Array, Float64Array ].forEach((t)=>{ H(t, t.name, 31 - Math.clz32(t.BYTES_PER_ELEMENT)); }); if (_) { [ BigUint64Array, BigInt64Array ].forEach((t)=>{ H(t, t.name.slice(3), 3); }); } function J(t, r) { const n = new Uint32Array(E.buffer); let i = n[t + e >>> 2]; if (i <= R(n)) { do { if (i == r) return true; i = j(i); }while (i) } return false; } t.__instanceof = J; t.memory = t.memory || E; t.table = t.table || x; return P(S, t); } function k(t) { return typeof Response !== "undefined" && t instanceof Response; } function I(t) { return t instanceof WebAssembly.Module; } async function R(t, e = {}) { if (k(t = await t)) return j(t, e); const r = I(t) ? t : await WebAssembly.compile(t); const n = A(e); const i = await WebAssembly.instantiate(r, e); const o = O(n, i); return { module: r, instance: i, exports: o }; } function N(t, e = {}) { const r = I(t) ? t : new WebAssembly.Module(t); const n = A(e); const i = new WebAssembly.Instance(r, e); const o = O(n, i); return { module: r, instance: i, exports: o }; } async function j(t, e = {}) { if (!WebAssembly.instantiateStreaming) { return R(k(t = await t) ? t.arrayBuffer() : t, e); } const r = A(e); const n = await WebAssembly.instantiateStreaming(t, e); const i = O(r, n.instance); return { ...n, exports: i }; } function P(t, e = {}) { const r = t["__argumentsLength"] ? (e)=>{ t["__argumentsLength"].value = e; } : t["__setArgumentsLength"] || t["__setargc"] || (()=>{}); for (let n of Object.keys(t)){ const i = t[n]; let o = n.split("."); let s = e; while(o.length > 1){ let a = o.shift(); if (!Object.hasOwn(s, a)) s[a] = {}; s = s[a]; } let f = o[0]; let u = f.indexOf("#"); if (u >= 0) { const c = f.substring(0, u); const l = s[c]; if (typeof l === "undefined" || !l.prototype) { const h = function(...t) { return h.wrap(h.prototype.constructor(0, ...t)); }; h.prototype = { valueOf () { return this[S]; } }; h.wrap = function(t) { return Object.create(h.prototype, { [S]: { value: t, writable: false } }); }; if (l) Object.getOwnPropertyNames(l).forEach((t)=>Object.defineProperty(h, t, Object.getOwnPropertyDescriptor(l, t))); s[c] = h; } f = f.substring(u + 1); s = s[c].prototype; if (/^(get|set):/.test(f)) { if (!Object.hasOwn(s, f = f.substring(4))) { let d = t[n.replace("set:", "get:")]; let p = t[n.replace("get:", "set:")]; Object.defineProperty(s, f, { get () { return d(this[S]); }, set (t) { p(this[S], t); }, enumerable: true }); } } else { if (f === 'constructor') { (s[f] = function(...t) { r(t.length); return i(...t); }).original = i; } else { (s[f] = function(...t) { r(t.length); return i(this[S], ...t); }).original = i; } } } else { if (/^(get|set):/.test(f)) { if (!Object.hasOwn(s, f = f.substring(4))) { Object.defineProperty(s, f, { get: t[n.replace("set:", "get:")], set: t[n.replace("get:", "set:")], enumerable: true }); } } else if (typeof i === "function" && i !== r) { (s[f] = (...t)=>{ r(t.length); return i(...t); }).original = i; } else { s[f] = i; } } } return e; } var C = { instantiate: R, instantiateSync: N, instantiateStreaming: j, demangle: P }; t.default = C; return "default" in t ? t.default : t; })({}); if (true) !(r = [], n = (function() { return i; }).apply(e, r), n !== undefined && (t.exports = n)); else {} }), 3083: (function(t, e, r) { "use strict"; var n = [ 'BigInt64Array', 'BigUint64Array', 'Float32Array', 'Float64Array', 'Int16Array', 'Int32Array', 'Int8Array', 'Uint16Array', 'Uint32Array', 'Uint8Array', 'Uint8ClampedArray' ]; var i = typeof globalThis === 'undefined' ? r.g : globalThis; t.exports = function t() { var e = []; for(var r = 0; r < n.length; r++){ if (typeof i[n[r]] === 'function') { e[e.length] = n[r]; } } return e; }; }), 882: (function(t, e, r) { "use strict"; var n = r(210); var i = n('%Object.getOwnPropertyDescriptor%', true); if (i) { try { i([], 'length'); } catch (o) { i = null; } } t.exports = i; }), 7568: (function(t, e, r) { "use strict"; r.d(e, { "Z": function() { return i; } }); function n(t, e, r, n, i, o, s) { try { var a = t[o](s); var f = a.value; } catch (u) { r(u); return; } if (a.done) { e(f); } else { Promise.resolve(f).then(n, i); } } function i(t) { return function() { var e = this, r = arguments; return new Promise(function(i, o) { var s = t.apply(e, r); function a(t) { n(s, i, o, a, f, "next", t); } function f(t) { n(s, i, o, a, f, "throw", t); } a(undefined); }); }; } }), 9396: (function(t, e, r) { "use strict"; r.d(e, { "Z": function() { return i; } }); function n(t, e) { var r = Object.keys(t); if (Object.getOwnPropertySymbols) { var n = Object.getOwnPropertySymbols(t); if (e) { n = n.filter(function(e) { return Object.getOwnPropertyDescriptor(t, e).enumerable; }); } r.push.apply(r, n); } return r; } function i(t, e) { e = e != null ? e : {}; if (Object.getOwnPropertyDescriptors) { Object.defineProperties(t, Object.getOwnPropertyDescriptors(e)); } else { n(Object(e)).forEach(function(r) { Object.defineProperty(t, r, Object.getOwnPropertyDescriptor(e, r)); }); } return t; } }), 8597: (function(t) { "use strict"; t.exports = { "i8": "6.5.4" }; }), 2454: (function(t) { "use strict"; t.exports = JSON.parse('{"O_RDONLY":0,"O_WRONLY":1,"O_RDWR":2,"S_IFMT":61440,"S_IFREG":32768,"S_IFDIR":16384,"S_IFCHR":8192,"S_IFBLK":24576,"S_IFIFO":4096,"S_IFLNK":40960,"S_IFSOCK":49152,"O_CREAT":512,"O_EXCL":2048,"O_NOCTTY":131072,"O_TRUNC":1024,"O_APPEND":8,"O_DIRECTORY":1048576,"O_NOFOLLOW":256,"O_SYNC":128,"O_SYMLINK":2097152,"O_NONBLOCK":4,"S_IRWXU":448,"S_IRUSR":256,"S_IWUSR":128,"S_IXUSR":64,"S_IRWXG":56,"S_IRGRP":32,"S_IWGRP":16,"S_IXGRP":8,"S_IRWXO":7,"S_IROTH":4,"S_IWOTH":2,"S_IXOTH":1,"E2BIG":7,"EACCES":13,"EADDRINUSE":48,"EADDRNOTAVAIL":49,"EAFNOSUPPORT":47,"EAGAIN":35,"EALREADY":37,"EBADF":9,"EBADMSG":94,"EBUSY":16,"ECANCELED":89,"ECHILD":10,"ECONNABORTED":53,"ECONNREFUSED":61,"ECONNRESET":54,"EDEADLK":11,"EDESTADDRREQ":39,"EDOM":33,"EDQUOT":69,"EEXIST":17,"EFAULT":14,"EFBIG":27,"EHOSTUNREACH":65,"EIDRM":90,"EILSEQ":92,"EINPROGRESS":36,"EINTR":4,"EINVAL":22,"EIO":5,"EISCONN":56,"EISDIR":21,"ELOOP":62,"EMFILE":24,"EMLINK":31,"EMSGSIZE":40,"EMULTIHOP":95,"ENAMETOOLONG":63,"ENETDOWN":50,"ENETRESET":52,"ENETUNREACH":51,"ENFILE":23,"ENOBUFS":55,"ENODATA":96,"ENODEV":19,"ENOENT":2,"ENOEXEC":8,"ENOLCK":77,"ENOLINK":97,"ENOMEM":12,"ENOMSG":91,"ENOPROTOOPT":42,"ENOSPC":28,"ENOSR":98,"ENOSTR":99,"ENOSYS":78,"ENOTCONN":57,"ENOTDIR":20,"ENOTEMPTY":66,"ENOTSOCK":38,"ENOTSUP":45,"ENOTTY":25,"ENXIO":6,"EOPNOTSUPP":102,"EOVERFLOW":84,"EPERM":1,"EPIPE":32,"EPROTO":100,"EPROTONOSUPPORT":43,"EPROTOTYPE":41,"ERANGE":34,"EROFS":30,"ESPIPE":29,"ESRCH":3,"ESTALE":70,"ETIME":101,"ETIMEDOUT":60,"ETXTBSY":26,"EWOULDBLOCK":35,"EXDEV":18,"SIGHUP":1,"SIGINT":2,"SIGQUIT":3,"SIGILL":4,"SIGTRAP":5,"SIGABRT":6,"SIGIOT":6,"SIGBUS":10,"SIGFPE":8,"SIGKILL":9,"SIGUSR1":30,"SIGSEGV":11,"SIGUSR2":31,"SIGPIPE":13,"SIGALRM":14,"SIGTERM":15,"SIGCHLD":20,"SIGCONT":19,"SIGSTOP":17,"SIGTSTP":18,"SIGTTIN":21,"SIGTTOU":22,"SIGURG":16,"SIGXCPU":24,"SIGXFSZ":25,"SIGVTALRM":26,"SIGPROF":27,"SIGWINCH":28,"SIGIO":23,"SIGSYS":12,"SSL_OP_ALL":2147486719,"SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION":262144,"SSL_OP_CIPHER_SERVER_PREFERENCE":4194304,"SSL_OP_CISCO_ANYCONNECT":32768,"SSL_OP_COOKIE_EXCHANGE":8192,"SSL_OP_CRYPTOPRO_TLSEXT_BUG":2147483648,"SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS":2048,"SSL_OP_EPHEMERAL_RSA":0,"SSL_OP_LEGACY_SERVER_CONNECT":4,"SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER":32,"SSL_OP_MICROSOFT_SESS_ID_BUG":1,"SSL_OP_MSIE_SSLV2_RSA_PADDING":0,"SSL_OP_NETSCAPE_CA_DN_BUG":536870912,"SSL_OP_NETSCAPE_CHALLENGE_BUG":2,"SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG":1073741824,"SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG":8,"SSL_OP_NO_COMPRESSION":131072,"SSL_OP_NO_QUERY_MTU":4096,"SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION":65536,"SSL_OP_NO_SSLv2":16777216,"SSL_OP_NO_SSLv3":33554432,"SSL_OP_NO_TICKET":16384,"SSL_OP_NO_TLSv1":67108864,"SSL_OP_NO_TLSv1_1":268435456,"SSL_OP_NO_TLSv1_2":134217728,"SSL_OP_PKCS1_CHECK_1":0,"SSL_OP_PKCS1_CHECK_2":0,"SSL_OP_SINGLE_DH_USE":1048576,"SSL_OP_SINGLE_ECDH_USE":524288,"SSL_OP_SSLEAY_080_CLIENT_DH_BUG":128,"SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG":0,"SSL_OP_TLS_BLOCK_PADDING_BUG":512,"SSL_OP_TLS_D5_BUG":256,"SSL_OP_TLS_ROLLBACK_BUG":8388608,"ENGINE_METHOD_DSA":2,"ENGINE_METHOD_DH":4,"ENGINE_METHOD_RAND":8,"ENGINE_METHOD_ECDH":16,"ENGINE_METHOD_ECDSA":32,"ENGINE_METHOD_CIPHERS":64,"ENGINE_METHOD_DIGESTS":128,"ENGINE_METHOD_STORE":256,"ENGINE_METHOD_PKEY_METHS":512,"ENGINE_METHOD_PKEY_ASN1_METHS":1024,"ENGINE_METHOD_ALL":65535,"ENGINE_METHOD_NONE":0,"DH_CHECK_P_NOT_SAFE_PRIME":2,"DH_CHECK_P_NOT_PRIME":1,"DH_UNABLE_TO_CHECK_GENERATOR":4,"DH_NOT_SUITABLE_GENERATOR":8,"NPN_ENABLED":1,"RSA_PKCS1_PADDING":1,"RSA_SSLV23_PADDING":2,"RSA_NO_PADDING":3,"RSA_PKCS1_OAEP_PADDING":4,"RSA_X931_PADDING":5,"RSA_PKCS1_PSS_PADDING":6,"POINT_CONVERSION_COMPRESSED":2,"POINT_CONVERSION_UNCOMPRESSED":4,"POINT_CONVERSION_HYBRID":6,"F_OK":0,"R_OK":4,"W_OK":2,"X_OK":1,"UV_UDP_REUSEADDR":4}'); }), 8575: (function(t) { "use strict"; t.exports = JSON.parse('{"block":"block_type","loop":"block_type","if":"block_type","br":"varuint32","br_if":"varuint32","br_table":"br_table","call":"varuint32","call_indirect":"call_indirect","get_local":"varuint32","set_local":"varuint32","tee_local":"varuint32","get_global":"varuint32","set_global":"varuint32","load":"memory_immediate","load8_s":"memory_immediate","load8_u":"memory_immediate","load16_s":"memory_immediate","load16_u":"memory_immediate","load32_s":"memory_immediate","load32_u":"memory_immediate","store":"memory_immediate","store8":"memory_immediate","store16":"memory_immediate","store32":"memory_immediate","current_memory":"varuint1","grow_memory":"varuint1","i32":"varint32","i64":"varint64","f32":"uint32","f64":"uint64"}'); }), 5936: (function(t) { "use strict"; t.exports = JSON.parse('{"start":0,"type":{"params":{"DEFAULT":0},"return_type":{"DEFAULT":0}},"import":0,"code":{"locals":{"DEFAULT":1},"code":{"get_local":120,"set_local":120,"tee_local":120,"get_global":120,"set_global":120,"load8_s":120,"load8_u":120,"load16_s":120,"load16_u":120,"load32_s":120,"load32_u":120,"load":120,"store8":120,"store16":120,"store32":120,"store":120,"grow_memory":10000,"current_memory":100,"nop":1,"block":1,"loop":1,"if":1,"then":90,"else":90,"br":90,"br_if":90,"br_table":120,"return":90,"call":90,"call_indirect":10000,"const":1,"add":45,"sub":45,"mul":45,"div_s":36000,"div_u":36000,"rem_s":36000,"rem_u":36000,"and":45,"or":45,"xor":45,"shl":67,"shr_u":67,"shr_s":67,"rotl":90,"rotr":90,"eq":45,"eqz":45,"ne":45,"lt_s":45,"lt_u":45,"le_s":45,"le_u":45,"gt_s":45,"gt_u":45,"ge_s":45,"ge_u":45,"clz":45,"ctz":45,"popcnt":45,"drop":120,"select":120,"unreachable":1}},"data":0}'); }) } ]);